instana / ruby-sensor

💎 Ruby Distributed Tracing & Metrics Sensor for Instana
https://www.instana.com/
MIT License
26 stars 25 forks source link

Rename downstream services #186

Closed scalp42 closed 3 years ago

scalp42 commented 3 years ago

Hi @pglombardo

How can you rename a downstream service?

Say you have application foo talking to a bar RDS DB.

We can pass INSTANA_SERVICE_NAME to rename foo as foo-app but how can we rename the downstream service/entity we're talking to?

For example, with Datadog you can do something like this:

Datadog.configure do |c|
    c.service = 'foo-rails'
    c.use :rails
    c.use :sidekiq, analytics_enabled: true, client_service_name: 'foo-sidekiq-client', service_name: 'foo-sidekiq', tag_args: true
    c.use :rake, analytics_enabled: true, service_name: 'foo-rake', quantize: { args: { show: :all } }
    c.use :redis, analytics_enabled: true, service_name: 'foo-redis'
    c.use :aws, analytics_enabled: true, service_name: 'foo-aws'

Thanks in advance

pglombardo commented 3 years ago

Hi Anthony! We have some documentation on this here: https://www.instana.com/docs/application_monitoring/services/#customize-service-mapping

We generally recommend centralised configuration in the dashboard as it's easier to maintain and sidesteps naming conflicts. Plus less vendor lock-in never hurts.

If you still prefer to do it from code, we also support a request header X-Instana-Service which could be another option for you.

I hope this helps. Best

mmanciop commented 3 years ago

To better clarify what Peter wrote, we do not have the renaming of services we do monitor as a use-case we cover. However, we think it would work if you went and added to the spans that represent the requests leaving your application the following tag: http.header.x-instana-service with its value as the name of the other service.

In the future, I think it might be easier if you opened a ticket on https://support.instana.com/, especially when the issue is not clearly in the Ruby sensor code :-)

mmanciop commented 3 years ago

And you actually did open https://instana.zendesk.com/agent/tickets/16381, very nice :-)

scalp42 commented 3 years ago

Closing as it's not possible unfortunately.