Giter Club home page Giter Club logo

Comments (6)

dalen avatar dalen commented on May 28, 2024 1

Yeah, doing it in code solves the issue for me for now, thanks for the pointers.

You can close it or keep it as a feature request to actually add that environment variable :)

from datadog-trace-agent.

gbbr avatar gbbr commented on May 28, 2024 1

Great! Ok, let's keep it as a proposal. Slightly edited the title.

from datadog-trace-agent.

gbbr avatar gbbr commented on May 28, 2024

Do you not have access or the possibility to change the config? You can also set the env tag on traces for the same effect. Most tracers have global tags which you can initialize them with. For Go it would be:

tracer.Start(tracer.WithGlobalTag(ext.Environment, "name"))

from datadog-trace-agent.

dalen avatar dalen commented on May 28, 2024

I run it as a container in the ECS task, so to change the config file I would need a custom container image for each environment instead of just being able to use the datadog/agent:latest image. That would be doable, but a bit more cumbersome than just setting an ENV variable depening on environment.

The project I'm setting up at the moment is a rails project, but I can check if I can set the environment in the tracer config there in the meantime.

But anyway, adding DD_APM_ENV to the list at https://github.com/DataDog/datadog-trace-agent/blob/master/config/merge_env.go#L13-L29 would be really helpful.

from datadog-trace-agent.

gbbr avatar gbbr commented on May 28, 2024

The project I'm setting up at the moment is a rails project, but I can check if I can set the environment in the tracer config there in the meantime.

Should be easy based on the Ruby tracer documentation: https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md#environment-and-tags

But anyway, adding DD_APM_ENV to the list at https://github.com/DataDog/datadog-trace-agent/blob/master/config/merge_env.go#L13-L29 would be really helpful.

I agree with you. This isn't the only case where an environment variable is missing as 1:1 mapping on the config. We'll have to consider better solutions to this.

For the environment variable, you can now do it in code; but if there's every anything else you can always just create a new Docker image based on the Datadog one and copy your own config into it.

Please let me know if this solves your problem, in which case we can close the issue.

from datadog-trace-agent.

gbbr avatar gbbr commented on May 28, 2024

I think it might be best after all to close this now since the problem has a solution.

In a next release (soon) most config options will be settable via environment variables too.

from datadog-trace-agent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.