Skip to content

Commit c407f31

Browse files
committed
Fix lint & add @experimental tags.
1 parent 5ac7921 commit c407f31

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

experimental/packages/sdk-logs/src/Logger.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@
1717
import type * as logsAPI from '@opentelemetry/api-logs';
1818
import { SeverityNumber } from '@opentelemetry/api-logs';
1919
import type { InstrumentationScope } from '@opentelemetry/core';
20-
import { context, trace, TraceFlags, isSpanContextValid } from '@opentelemetry/api';
20+
import {
21+
context,
22+
trace,
23+
TraceFlags,
24+
isSpanContextValid,
25+
} from '@opentelemetry/api';
2126

2227
import { LogRecordImpl } from './LogRecordImpl';
2328
import { LoggerProviderSharedState } from './internal/LoggerProviderSharedState';
@@ -57,7 +62,8 @@ export class Logger implements logsAPI.Logger {
5762
const spanContext = trace.getSpanContext(currentContext);
5863
if (spanContext && isSpanContextValid(spanContext)) {
5964
// Check if the trace is unsampled (SAMPLED flag is unset)
60-
const isSampled = (spanContext.traceFlags & TraceFlags.SAMPLED) === TraceFlags.SAMPLED;
65+
const isSampled =
66+
(spanContext.traceFlags & TraceFlags.SAMPLED) === TraceFlags.SAMPLED;
6167
if (!isSampled) {
6268
// Log record is dropped due to trace-based filter
6369
return;

experimental/packages/sdk-logs/src/config/LoggerConfigurators.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ export interface LoggerPattern {
4040
/**
4141
* The configuration to apply to matching loggers.
4242
* Partial config is allowed; unspecified properties will use defaults.
43+
*
44+
* @experimental This feature is in development as per the OpenTelemetry specification.
4345
*/
4446
config: LoggerConfig;
4547
}
@@ -54,6 +56,7 @@ export interface LoggerPattern {
5456
*
5557
* @param patterns - Array of logger patterns with their configurations
5658
* @returns A LoggerConfigurator function that computes complete LoggerConfig
59+
* @experimental This feature is in development as per the OpenTelemetry specification.
5760
*
5861
* @example
5962
* ```typescript

experimental/packages/sdk-logs/src/internal/LoggerProviderSharedState.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ export class LoggerProviderSharedState {
6868
* Get the LoggerConfig for a given instrumentation scope.
6969
* Uses the LoggerConfigurator function to compute the config on first access
7070
* and caches the result.
71+
*
72+
* @experimental This feature is in development as per the OpenTelemetry specification.
7173
*/
7274
getLoggerConfig(
7375
instrumentationScope: InstrumentationScope

experimental/packages/sdk-logs/src/types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export interface LoggerConfig {
3535
* If not explicitly set, defaults to 0 (UNSPECIFIED).
3636
* Log records with a specified severity (i.e. not 0) that is less than this value will be dropped.
3737
* Log records with unspecified severity (0) bypass this filter.
38+
*
39+
* @experimental This feature is in development as per the OpenTelemetry specification.
3840
*/
3941
minimumSeverity?: SeverityNumber;
4042

@@ -43,6 +45,8 @@ export interface LoggerConfig {
4345
* associated with sampled traces.
4446
* If not explicitly set, defaults to false.
4547
* If true, log records associated with unsampled traces will be dropped.
48+
*
49+
* @experimental This feature is in development as per the OpenTelemetry specification.
4650
*/
4751
traceBased?: boolean;
4852
}
@@ -57,6 +61,7 @@ export interface LoggerConfig {
5761
*
5862
* @param loggerScope - The InstrumentationScope of the Logger
5963
* @returns The computed LoggerConfig with all properties set
64+
* @experimental This feature is in development as per the OpenTelemetry specification.
6065
*/
6166
export type LoggerConfigurator = (
6267
loggerScope: InstrumentationScope
@@ -81,6 +86,8 @@ export interface LoggerProviderConfig {
8186
/**
8287
* A function that computes the LoggerConfig for a given logger.
8388
* This is called when a Logger is first created.
89+
*
90+
* @experimental This feature is in development as per the OpenTelemetry specification.
8491
*/
8592
loggerConfigurator?: LoggerConfigurator;
8693
}

0 commit comments

Comments
 (0)