platforms:
- type: GCE
  launch_stage: GA
  install_documentation_url: https://cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/third-party/nginx
  agent_requirement:
    logs_minimum_supported_version:
      major: 2
      minor: 1
      patch: 0
    metrics_minimum_supported_version:
      major: 2
      minor: 1
      patch: 0
  detections:
  - characteristic_log:
      log_name_regex: nginx
  - characteristic_metric:
      metric_type: workload.googleapis.com/nginx.requests
  default_logs:
  - name: nginx_access
    fields:
    - name: httpRequest.remoteIp
      type: string
      description: 'The IP address (IPv4 or IPv6) of the client that issued the HTTP
        request. This field can include port information. Examples: 192.168.1.1, 10.0.0.1:80,
        FE80::0202:B3FF:FE1E:8329.'
    - name: httpRequest.requestUrl
      type: string
      description: 'The scheme (http, https), the host name, the path and the query
        portion of the URL that was requested. Example: http://example.com/some/info?color=red.'
    - name: httpRequest.responseSize
      type: string
      description: ''
    - name: httpRequest.userAgent
      type: string
      description: ''
    - name: httpRequest.referer
      type: string
      description: ''
    - name: httpRequest.requestMethod
      type: string
      description: ''
    - name: httpRequest.status
      type: string
      description: ''
    - name: jsonPayload.host
      type: string
      description: Contents of the Host header (usually not reported by nginx)
    - name: jsonPayload.user
      type: string
      description: Authenticated username for the request
    - name: jsonPayload.level
      type: string
      description: Log entry level
    - name: severity
      type: string
      description: ''
  - name: nginx_error
    fields:
    - name: jsonPayload.client
      type: string
      description: Client IP address (optional)
    - name: jsonPayload.level
      type: string
      description: Log entry level
    - name: jsonPayload.message
      type: string
      description: Log message
    - name: jsonPayload.request
      type: string
      description: Original HTTP request (optional)
    - name: jsonPayload.pid
      type: number
      description: The process ID issuing the log
    - name: jsonPayload.tid
      type: number
      description: Thread ID where the log originated
    - name: jsonPayload.connection
      type: number
      description: Connection ID
    - name: jsonPayload.server
      type: string
      description: Nginx server name (optional)
    - name: jsonPayload.subrequest
      type: string
      description: Nginx subrequest (optional)
    - name: jsonPayload.upstream
      type: string
      description: Upstream request URI (optional)
    - name: jsonPayload.host
      type: string
      description: Host header (optional)
    - name: jsonPayload.referer
      type: string
      description: Referer header (optional)
    - name: severity
      type: string
      description: ''
  default_metrics:
  - name: workload.googleapis.com/nginx.connections_accepted
    value_type: INT64
    kind: CUMULATIVE
    labels: []
  - name: workload.googleapis.com/nginx.connections_current
    value_type: INT64
    kind: GAUGE
    labels:
    - state
  - name: workload.googleapis.com/nginx.connections_handled
    value_type: INT64
    kind: CUMULATIVE
    labels: []
  - name: workload.googleapis.com/nginx.requests
    value_type: INT64
    kind: CUMULATIVE
    labels: []
