Skip to content

Commit

Permalink
feat: configure tracing logger via env var
Browse files Browse the repository at this point in the history
Signed-off-by: Naseem <naseem@transit.app>
  • Loading branch information
Naseem committed Apr 18, 2020
1 parent 609dfa3 commit a47135c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/opentelemetry-tracing/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { ALWAYS_SAMPLER, LogLevel } from '@opentelemetry/core';
import { ALWAYS_SAMPLER, LogLevel, LogLevelStrings } from '@opentelemetry/core';

/** Default limit for Message events per span */
export const DEFAULT_MAX_EVENTS_PER_SPAN = 128;
Expand All @@ -31,7 +31,9 @@ export const DEFAULT_MAX_LINKS_PER_SPAN = 32;
*/
export const DEFAULT_CONFIG = {
defaultAttributes: {},
logLevel: LogLevel.INFO,
logLevel: process.env.OTEL_LOG_LEVEL
? LogLevel[process.env.OTEL_LOG_LEVEL as LogLevelStrings]
: LogLevel.INFO,
sampler: ALWAYS_SAMPLER,
traceParams: {
numberOfAttributesPerSpan: DEFAULT_MAX_ATTRIBUTES_PER_SPAN,
Expand Down

0 comments on commit a47135c

Please sign in to comment.