Skip to content

refactor(agent): expose trace id and span id with app metadata#933

Open
anmol-ap wants to merge 5 commits into
refactor/security-agent-supportfrom
add/refactor/security-agent-support
Open

refactor(agent): expose trace id and span id with app metadata#933
anmol-ap wants to merge 5 commits into
refactor/security-agent-supportfrom
add/refactor/security-agent-support

Conversation

@anmol-ap

@anmol-ap anmol-ap commented Jul 2, 2024

Copy link
Copy Markdown

Along with other app metadata, expose trace id and span id as well

@anmol-ap anmol-ap requested a review from ZNeumann July 2, 2024 06:23
@newrelic-php-agent-bot

newrelic-php-agent-bot commented Jul 2, 2024

Copy link
Copy Markdown
Test Suite Status Result
Multiverse 0/8 passing
SOAK 76/79 passing

@codecov-commenter

codecov-commenter commented Jul 2, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.

Project coverage is 77.24%. Comparing base (587a75d) to head (95e02cd).

Files with missing lines Patch % Lines
agent/csec_metadata.c 0.00% 15 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                         @@
##           refactor/security-agent-support     #933      +/-   ##
===================================================================
- Coverage                            77.27%   77.24%   -0.04%     
===================================================================
  Files                                  199      199              
  Lines                                27785    27797      +12     
===================================================================
  Hits                                 21472    21472              
- Misses                                6313     6325      +12     
Flag Coverage Δ
agent-for-php-7.2 77.36% <0.00%> (-0.04%) ⬇️
agent-for-php-7.3 77.38% <0.00%> (-0.04%) ⬇️
agent-for-php-7.4 77.10% <0.00%> (-0.04%) ⬇️
agent-for-php-8.0 76.49% <0.00%> (-0.04%) ⬇️
agent-for-php-8.1 76.99% <0.00%> (-0.04%) ⬇️
agent-for-php-8.2 76.61% <0.00%> (-0.04%) ⬇️
agent-for-php-8.3 76.61% <0.00%> (-0.04%) ⬇️
agent-for-php-8.4 76.62% <0.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread agent/csec_metadata.c
is_allocated = true;
break;
case NR_PHP_CSEC_METADATA_SPAN_ID:
id_value = nr_txn_get_current_span_id(NRPRG(txn));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The span id will be different depending on which agent's instrumentation is called first with OAPI

@bduranleau-nr bduranleau-nr added the on hold This issue or pull request is necessary, but better suited for the future label Nov 4, 2024
@anmol-ap

anmol-ap commented Jan 24, 2025

Copy link
Copy Markdown
Author

@ZNeumann @lavarou @bduranleau-nr
Could you please review the PRs now.

  • The config has been moved to a separate config file at csec agent.
  • newrelic.security.agent.enabled and newrelic.security.enabled are read in the APM agent for logging purpose.
  • Metadata required by csec agent has been exposed by api.
  • We are going ahead with separate installation approach as decided.

Related PRs :
#933
#922
#918

@anmol-ap

Copy link
Copy Markdown
Author

Rebased the branch.

@anmol-ap anmol-ap force-pushed the refactor/security-agent-support branch from 587a75d to 2f616e1 Compare March 13, 2025 06:14
@anmol-ap anmol-ap force-pushed the add/refactor/security-agent-support branch from 95e02cd to 5e94611 Compare March 13, 2025 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

csec-agent on hold This issue or pull request is necessary, but better suited for the future

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants