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

can't set global labels from environment #1196

Closed
brettmc opened this issue Jul 16, 2024 · 2 comments
Closed

can't set global labels from environment #1196

brettmc opened this issue Jul 16, 2024 · 2 comments
Assignees
Labels
agent-php bug Something isn't working

Comments

@brettmc
Copy link

brettmc commented Jul 16, 2024

Describe the bug
Documentation suggests that you can set global labels via the environment variable ELASTIC_APM_GLOBAL_LABELS. When I set this value in an agent, I see no extra labels in APM. Searching the codebase here, I see no reference to the variable in code, just one mention in docs.

To Reproduce
Steps to reproduce the behavior:

  1. Set `ELASTIC_APM_GLOBAL_LABELS=foo=bar,baz=bat"
  2. Execute the application, causing a trace to be generated
  3. View into the transaction's metadata in APM
  4. See no extra labels

Expected behavior
Extra labels to be visible in APM.

@brettmc brettmc added the bug Something isn't working label Jul 16, 2024
@intuibase intuibase self-assigned this Aug 27, 2024
@intuibase
Copy link
Contributor

Hey @brettmc

I tested it by calling simple test app

ELASTIC_APM_GLOBAL_LABELS=foo=bar,baz=bat php8.2 /var/www/html/curl.php 

and got result:

Image

Could you verify if env variable was set correctly?
It can be done by enabling debug level logs in agent or you can just dump env from PHP app.

Thanks,
Pawel

@brettmc
Copy link
Author

brettmc commented Aug 30, 2024

Verified that this does work. I was using a quite old version of the agent (1.5), but upgrading to the most recent version fixed it. Sorry for the noise.

@brettmc brettmc closed this as completed Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-php bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants