Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenTelemetry Tracing - resource attribute service.name = unknown_service:traefik #9617

Closed
2 tasks done
pomverte opened this issue Dec 25, 2022 · 1 comment · Fixed by #9619
Closed
2 tasks done

OpenTelemetry Tracing - resource attribute service.name = unknown_service:traefik #9617

pomverte opened this issue Dec 25, 2022 · 1 comment · Fixed by #9619

Comments

@pomverte
Copy link

pomverte commented Dec 25, 2022

Welcome!

  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've searched similar issues on the Traefik community forum and didn't find any.

What did you do?

  • Traefik is configured to send OpenTelemetry Tracing to OpenTelemety Collector
  • OpenTelemety Collector sends tracing data to Tempo
  • Grafana is plugged on Tempo as a datasource
Traefik ==> OpenTelemety Collector ==> Tempo ==> Grafana

I expect to see traces in Grafana attached to the service traefik

What did you see instead?

The service is unknown_service:traefik

What version of Traefik are you using?

3.0.0-beta2

What is your environment & configuration?

docker-compose.yml

---
version: "2"
services:

  traefik:
    container_name: traefik
    image: traefik:v3.0
    command:
      - "--accesslog=true"
      - "--api.insecure=true"
      - "--entryPoints.metrics.address=:8082"
      - "--entrypoints.http.address=:80"
      - "--log.level=DEBUG"
      - "--metrics.prometheus=true"
      - "--metrics.prometheus.addrouterslabels=true"
      - "--metrics.prometheus.entryPoint=metrics"
      - "--providers.docker.exposedbydefault=false"
      - "--providers.docker=true"
      - "--tracing.serviceName=traefik"
      - "--tracing.openTelemetry=true"
      - "--tracing.openTelemetry.address=otel-collector:4317"
      - "--tracing.openTelemetry.grpc=true"
      - "--tracing.openTelemetry.insecure=true"
    ports:
      - 80:80
      - 8080:8080
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"

  otel-collector:
    container_name: otel
    image: otel/opentelemetry-collector:0.68.0
    command: [ "--config=/etc/otel-collector.yml" ]
    volumes:
      - ./otel-collector.yml:/etc/otel-collector.yml:ro

  tempo:
    container_name: tempo
    image: grafana/tempo:1.5.0
    command: [ "-config.file=/etc/tempo.yml" ]
    volumes:
      - ./tempo.yml:/etc/tempo.yml:ro

  grafana:
    container_name: grafana
    image: grafana/grafana:9.3.2
    volumes:
      - ./grafana-datasources.yml:/etc/grafana/provisioning/datasources/datasources.yml:ro
    environment:
      - GF_AUTH_DISABLE_LOGIN_FORM=true
      - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
      - GF_AUTH_ANONYMOUS_ENABLED=true
    labels:
      - traefik.enable=true
      - traefik.http.routers.grafana.rule=Host(`grafana.localhost`)
      - traefik.http.routers.grafana.entrypoints=http
    depends_on:
      - tempo

otel-collector.yml

---
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317

exporters:
  logging:
    loglevel: debug
  otlp:
    endpoint: tempo:4317
    tls:
      insecure: true

processors:
  batch:

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [logging, otlp]

grafana-datasources.yml

---
apiVersion: 1
datasources:
  - name: Tempo
    type: tempo
    access: proxy
    orgId: 1
    url: http://tempo:3200
    basicAuth: false
    isDefault: true
    version: 1
    editable: false
    apiVersion: 1
    uid: tempo
    jsonData:
      httpMethod: GET

If applicable, please paste the log output in DEBUG level

traefik  | 2022/12/25 19:28:41 OTLP partial success: empty message (0 spans rejected)
otel     | 2022-12-25T19:28:41.499Z     info    TracesExporter  {"kind": "exporter", "data_type": "traces", "name": "logging", "#spans": 2}
otel     | 2022-12-25T19:28:41.500Z     info    ResourceSpans #0
otel     | Resource SchemaURL: https://opentelemetry.io/schemas/1.12.0
otel     | Resource attributes:
otel     |      -> service.name: Str(unknown_service:traefik)
otel     |      -> telemetry.sdk.language: Str(go)
otel     |      -> telemetry.sdk.name: Str(opentelemetry)
otel     |      -> telemetry.sdk.version: Str(1.11.1)
otel     | ScopeSpans #0
otel     | ScopeSpans SchemaURL: 
otel     | InstrumentationScope traefik 3.0.0-beta2
otel     | Span #0
otel     |     Trace ID       : 9d207393c34b83aec17d9b054638fb16
otel     |     Parent ID      : 14244e8b03576866
otel     |     ID             : b281c6f1eed7ce96
otel     |     Name           : forward api@internal/api@internal
otel     |     Kind           : Internal
otel     |     Start time     : 2022-12-25 19:28:36.968077 +0000 UTC
otel     |     End time       : 2022-12-25 19:28:36.968162 +0000 UTC
otel     |     Status code    : Unset
otel     |     Status message : 
otel     | Attributes:
otel     |      -> traefik.service.name: Str(api@internal)
otel     |      -> traefik.router.name: Str(api@internal)
otel     |      -> http.method: Str(GET)
otel     |      -> http.url: Str(/api/overview)
otel     |      -> http.host: Str(localhost:8080)
otel     |      -> http.status_code: Int(200)
otel     | Span #1
otel     |     Trace ID       : 9d207393c34b83aec17d9b054638fb16
otel     |     Parent ID      : 
otel     |     ID             : 14244e8b03576866
otel     |     Name           : EntryPoint traefik localhost:8080
otel     |     Kind           : Server
otel     |     Start time     : 2022-12-25 19:28:36.967655 +0000 UTC
otel     |     End time       : 2022-12-25 19:28:36.968965 +0000 UTC
otel     |     Status code    : Unset
otel     |     Status message : 
otel     | Attributes:
otel     |      -> component: Str(traefik)
otel     |      -> http.method: Str(GET)
otel     |      -> http.url: Str(/api/overview)
otel     |      -> http.host: Str(localhost:8080)
otel     |      -> http.status_code: Int(200)
otel     |      {"kind": "exporter", "data_type": "traces", "name": "logging"}
traefik  | 2022-12-25T19:28:41Z DBG github.com/traefik/traefik/v2/pkg/middlewares/tracing/entrypoint.go:39 > Failed to extract the context error="opentracing: SpanContext not found in Extract carrier" middlewareName=tracing middlewareType=TracingEntryPoint
traefik  | 172.20.0.1 - - [25/Dec/2022:19:28:41 +0000] "GET /api/overview HTTP/1.1" 200 520 "-" "-" 108 "api@internal" "-" 0ms
@ddtmachado ddtmachado added kind/bug/possible a possible bug that needs analysis before it is confirmed or fixed. area/middleware/metrics and removed status/0-needs-triage labels Dec 26, 2022
@tomMoulard tomMoulard added the kind/bug/confirmed a confirmed bug (reproducible). label Dec 26, 2022
@tomMoulard tomMoulard removed the kind/bug/possible a possible bug that needs analysis before it is confirmed or fixed. label Dec 26, 2022
@tomMoulard tomMoulard linked a pull request Dec 27, 2022 that will close this issue
2 tasks
@tomMoulard
Copy link
Member

Fixed by #9619

@traefik traefik locked and limited conversation to collaborators Feb 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants