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

allow passing environment for sentry exporter #18694

Closed
fadeltd opened this issue Feb 16, 2023 · 6 comments
Closed

allow passing environment for sentry exporter #18694

fadeltd opened this issue Feb 16, 2023 · 6 comments
Assignees
Labels

Comments

@fadeltd
Copy link
Contributor

fadeltd commented Feb 16, 2023

Component(s)

exporter/sentry

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

Hi, I'd like to be able to pass an environment for the sentry exporter as it is currently not supported, for easier sentry filtering

Sentry Env

Describe the solution you'd like

exporters:
  sentry:
    dsn: https://key@host/path/42
    env: prod
    insecure_skip_verify: true

Describe alternatives you've considered

No response

Additional context

I can create a PR for this

@fadeltd fadeltd added enhancement New feature or request needs triage New item requiring triage labels Feb 16, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@AbhiPrasad
Copy link
Member

This makes sense, but I think we probably want to selectively grab the environment based on the incoming data, and not do it with a blanket collector config.

FYI we also have: getsentry/sentry#40712

@fadeltd
Copy link
Contributor Author

fadeltd commented Feb 16, 2023

This makes sense, but I think we probably want to selectively grab the environment based on the incoming data, and not do it with a blanket collector config.

FYI we also have: getsentry/sentry#40712

Well, for my projects, each project has their own separate config for each environment, so I only need to set the dsn value and the env, and this would work. I'm not sure if this is the best approach for other projects

@AbhiPrasad
Copy link
Member

I guess it's fair to just ship this for now to unblock you, but we should add documentation that this applies to every single event.

@fadeltd fadeltd closed this as completed Feb 20, 2023
@fadeltd
Copy link
Contributor Author

fadeltd commented Mar 2, 2023

Hi, I'm reopening this since I just found out that because sentryexporter is using transport
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/sentryexporter/transport.go#L36-L41, the environment value I set on sentry.ClientOptions isn't getting sent to the sentry

I need to actually attach the environment value on the transaction https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/sentryexporter/sentry_exporter.go#L437

		transaction.Environment = environment

any idea of how I can implement this with the same approach (using config)?

@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2023

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label May 8, 2023
@fadeltd fadeltd closed this as completed May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants