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

Feature add applyCustomAttributesOnMetric on HTTP Instrumentation #4884

Closed
wants to merge 1 commit into from

Conversation

evan361425
Copy link

Which problem is this PR solving?

Fixes #4317

add applyCustomAttributesOnMetric to hook metrics attributes.

Short description of the changes

interface HttpCustomMetricAttributeFunction {
  (span: Span, spanKind: SpanKind, metricAttributes: MetricAttributes): void;
}

Not same as origin issue:

export interface HttpCustomAttributeFunction {
  (
    span: Span,
    metricAttributes: Attributes,
    request: ClientRequest | IncomingMessage,
    response: IncomingMessage | ServerResponse
  ): void;
}

This is because _closeHttpSpan has only these arguments (Span and SpanKind).

If we really needed the request, more codebase need to change and verify.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Verify error callback won'y break the code

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added
  • Documentation has been updated

@evan361425 evan361425 requested a review from a team July 29, 2024 07:15
Copy link

linux-foundation-easycla bot commented Jul 29, 2024

CLA Signed


The committers listed above are authorized under a signed CLA.

@pichlermarc
Copy link
Member

Hi, thanks for your interest in contributing to OTel JS.

In order to add this feature, we need to ensure that it is safe for everyone to use before we release it into the wild, and there's some prerequisites we need before we can accept your contribution (namely #4095, #4096). Please head on over to #5051 to get a full summary of the current status - I'll keep updating that issue as we go through the process of discussing how we'd like to proceed with this.

Once we've decided if we want to add this or not, we'll create type:feature and type:feature-tracking issues to signal that this feature is ready for implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to add custom metric attributes to http_client_duration and http_server_duration
2 participants