apollographql / router

A configurable, high-performance routing runtime for Apollo Federation 🚀
https://www.apollographql.com/docs/router/
Other
807 stars 272 forks source link

Change default service name from unknown_service to apollo-router #5514

Closed smyrick closed 4 months ago

smyrick commented 4 months ago

Is your feature request related to a problem? Please describe.

We get lots of confusion with default router config with the name unknown_service. While I can rename the service with YAML config, the default configuration should not leave room for ambiguity

Describe the solution you'd like

Change the default name to apollo-router: https://github.com/apollographql/router/blob/9910ec5c7214768f9ca1a974c1679f5e7fa0c03a/apollo-router/src/plugins/telemetry/resource.rs#L11

Describe alternatives you've considered

I could update all my configs in YAML for tracing, metrics and logs, but this is annoying that I have to do it at all

telemetry:
  instrumentation:
    spans:
      mode: spec_compliant
      default_attribute_requirement_level: recommended

  exporters:
    tracing:
      common:
        service_name: "apollo-router"

    metrics: 
      common: 
        service_name: "apollo-router"

    logging: 
      common: 
        service_name: "apollo-router"

Additional context

This would change the default so any existing dashboards might break. Maybe consider for a major release?

BrynCooke commented 4 months ago

You can use an env variable to set this globally. But it is part of the spec that unknown_service is the default: https://opentelemetry.io/docs/languages/sdk-configuration/general/#otel_service_name

BrynCooke commented 4 months ago

@smyrick I'm going to close this, but if you'd like to discuss further then please reopen and we can talk it through.