-
Notifications
You must be signed in to change notification settings - Fork 1k
feat(opentelemetry-sdk-trace-base): implemented general limits of attributes #2430
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
Changes from all commits
399db0d
072ec2e
0c5dff8
7d1d51c
496ab0a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,7 @@ import { | |
| import { Resource } from '@opentelemetry/resources'; | ||
| import { BasicTracerProvider } from './BasicTracerProvider'; | ||
| import { Span } from './Span'; | ||
| import { SpanLimits, TracerConfig } from './types'; | ||
| import { GeneralLimits, SpanLimits, TracerConfig } from './types'; | ||
| import { mergeConfig } from './utility'; | ||
| import { SpanProcessor } from './SpanProcessor'; | ||
|
|
||
|
|
@@ -34,6 +34,7 @@ import { SpanProcessor } from './SpanProcessor'; | |
| */ | ||
| export class Tracer implements api.Tracer { | ||
| private readonly _sampler: api.Sampler; | ||
| private readonly _generalLimits: GeneralLimits; | ||
| private readonly _spanLimits: SpanLimits; | ||
| private readonly _idGenerator: IdGenerator; | ||
| readonly resource: Resource; | ||
|
|
@@ -49,6 +50,7 @@ export class Tracer implements api.Tracer { | |
| ) { | ||
| const localConfig = mergeConfig(config); | ||
| this._sampler = localConfig.sampler; | ||
| this._generalLimits = localConfig.generalLimits; | ||
| this._spanLimits = localConfig.spanLimits; | ||
| this._idGenerator = config.idGenerator || new RandomIdGenerator(); | ||
| this.resource = _tracerProvider.resource; | ||
|
|
@@ -212,6 +214,11 @@ export class Tracer implements api.Tracer { | |
| return api.context.with(contextWithSpanSet, fn, undefined, span); | ||
| } | ||
|
|
||
| /** Returns the active {@link GeneralLimits}. */ | ||
| getGeneralLimits(): GeneralLimits { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we have this function? It is not part of the interface. If it is just for testing, you can access the private field by doing
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can access the way you mentioned. I just followed the pattern we already have like |
||
| return this._generalLimits; | ||
| } | ||
|
|
||
| /** Returns the active {@link SpanLimits}. */ | ||
| getSpanLimits(): SpanLimits { | ||
| return this._spanLimits; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.