krakend / krakend-ce

KrakenD Community Edition: High-performance, stateless, declarative, API Gateway written in Go.
https://www.krakend.io
Apache License 2.0
1.98k stars 453 forks source link

Incorrect Opencensus data being exported to the Datadog Agent ? #675

Closed rom1gal closed 1 year ago

rom1gal commented 1 year ago

Environment info:

Describe what are you trying to do:

Hey there ๐Ÿ‘‹๐Ÿผ

Trying to export the traces (to Datadog agent APM) with correct information.

As you can see in the logs below :

Thus in my Datadog dashboard the 401 error is not showing ๐Ÿค”

Your configuration file:

[...]
    "telemetry/opencensus": {
      "sample_rate": 100,
      "reporting_period": 0,
      "exporters": {
        "datadog": {
          "tags": [
            "gw"
          ],
          "global_tags": {
            "env": "test"
          },
          "disable_count_per_buckets": true,
          "trace_address": "datadog_agent:8126",
          "stats_address": "datadog_agent:8125",
          "namespace": "krakend",
          "service": "gateway"
        }
      }
    },
[...]

{
  "endpoint": "/api/v1/categories",
  "method": "GET",
  "output_encoding": "no-op",
  "backend": [
    {
      "url_pattern": "/api/categories",
      "method": "GET",
      "encoding": "no-op",
      "host": [
        "http://{{ .backends.categories.host}}:{{ .backends.categories.port}}"
      ]
    }
  ],
  "input_query_strings": [
    "*"
  ],
  "input_headers":[
    "Authorization",
    "Accept-Language"
  ],
    "extra_config": {
    "auth/validator": {
      "alg": "RS256",
      "jwk_url": "https://<jwk_endpoint>",
      "operation_debug": "false",
      "cache": true
    }
  }
}

[...]

Configuration check output: Result of krakend check -dtc krakend.json --lint command

Output of the linter here.

Commands used: How did you start the software? 3 services are started by a compose file :

Krakend is started like this :

krakend run -c krakend.json

Logs: Here are the docker-compose logs :

krakend_1               | [GIN] 2023/02/10 - 18:30:48 | 401 |      56.457ยตs |      172.21.0.1 | GET      "/api/v1/categories?site=mysite"
datadog_agent_1         | 2023-02-10 18:30:48 UTC | PROCESS | TRACE | (pkg/forwarder/transaction/transaction.go:387 in internalProcess) | Successfully posted payload to "https://process.datadoghq.com/api/v1/collector": "\x01\x00\x17\x00\n\x02 \x17\x1a\x02\x10\x02"
datadog_agent_1         | 2023-02-10 18:30:48 UTC | CORE | TRACE | (pkg/collector/scheduler/job.go:180 in process) | Bucket ticked... current index: 8
datadog_agent_1         | 2023-02-10 18:30:48 UTC | CORE | TRACE | (pkg/collector/scheduler/job.go:196 in process) | Jobs in bucket: []
datadog_agent_1         | 2023-02-10 18:30:48 UTC | TRACE | TRACE | (run.go:248 in Tracef) | Handling new tracer payload with 1 spans: languageName:"go" languageVersion:"1.19.5" tracerVersion:"OC/0.1.0" chunks:<priority:1 spans:<service:"gateway" name:"opencensus" resource:"/api/v1/categories" traceID:907258798787984 spanID:1480487788874427 start:1676053848154961998 duration:38154 meta:<key:"env" value:"test" > meta:<key:"http.host" value:"localhost:8080" > meta:<key:"http.method" value:"GET" > meta:<key:"http.path" value:"/api/v1/categories" > meta:<key:"http.url" value:"/api/v1/categories?site=mysite" > meta:<key:"http.user_agent" value:"PostmanRuntime/7.30.0" > meta:<key:"opencensus.status" value:"OK" > meta:<key:"opencensus.status_code" value:"0" > metrics:<key:"_sampling_priority_rate_v1" value:1 > metrics:<key:"_sampling_priority_v1" value:1 > metrics:<key:"_top_level" value:1 > type:"server" > > env:"test" 

Additional comments:

coffeebe4code commented 1 year ago

This seems to be the same thing I am experiencing but with jaeger and not datadog. Would be curious to see what your logging settings are

rom1gal commented 1 year ago

This seems to be the same thing I am experiencing but with jaeger and not datadog. Would be curious to see what your logging settings are

@coffeebe4code here are my logging settings, just above the "telemetry/opencensus" block :

    "telemetry/logging": {
      "level": "DEBUG",
      "prefix": "[KRAKEND]",
      "syslog": false,
      "stdout": true
    },
github-actions[bot] commented 1 year ago

This issue is marked as stale because it has been open over 90 days with no activity. Remove the stale label or comment or this will be closed in 15 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been marked as stalled for 15 days with no activity.

github-actions[bot] commented 1 year ago

This issue was marked as resolved a long time ago and now has been automatically locked as there has not been any recent activity after it. You can still open a new issue and reference this link.