opentelemetry-api 0.16.0 → 1.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +57 -0
- data/README.md +3 -3
- data/lib/opentelemetry.rb +21 -28
- data/lib/opentelemetry/baggage.rb +95 -2
- data/lib/opentelemetry/baggage/builder.rb +30 -4
- data/lib/opentelemetry/baggage/entry.rb +20 -0
- data/lib/opentelemetry/baggage/propagation.rb +9 -18
- data/lib/opentelemetry/baggage/propagation/text_map_propagator.rb +111 -0
- data/lib/opentelemetry/context.rb +48 -33
- data/lib/opentelemetry/context/propagation.rb +35 -5
- data/lib/opentelemetry/context/propagation/composite_text_map_propagator.rb +105 -0
- data/lib/opentelemetry/context/propagation/noop_text_map_propagator.rb +27 -0
- data/lib/opentelemetry/context/propagation/{propagator.rb → text_map_propagator.rb} +23 -16
- data/lib/opentelemetry/internal.rb +17 -0
- data/lib/opentelemetry/internal/proxy_tracer.rb +38 -0
- data/lib/opentelemetry/internal/proxy_tracer_provider.rb +59 -0
- data/lib/opentelemetry/trace.rb +10 -0
- data/lib/opentelemetry/trace/propagation/trace_context.rb +7 -18
- data/lib/opentelemetry/trace/propagation/trace_context/text_map_propagator.rb +73 -0
- data/lib/opentelemetry/trace/status.rb +34 -5
- data/lib/opentelemetry/trace/tracer.rb +8 -9
- data/lib/opentelemetry/version.rb +1 -1
- metadata +16 -25
- data/lib/opentelemetry/baggage/manager.rb +0 -41
- data/lib/opentelemetry/baggage/propagation/text_map_extractor.rb +0 -57
- data/lib/opentelemetry/baggage/propagation/text_map_injector.rb +0 -52
- data/lib/opentelemetry/context/propagation/composite_propagator.rb +0 -72
- data/lib/opentelemetry/context/propagation/noop_extractor.rb +0 -26
- data/lib/opentelemetry/context/propagation/noop_injector.rb +0 -26
- data/lib/opentelemetry/instrumentation.rb +0 -15
- data/lib/opentelemetry/instrumentation/base.rb +0 -307
- data/lib/opentelemetry/instrumentation/registry.rb +0 -86
- data/lib/opentelemetry/metrics.rb +0 -16
- data/lib/opentelemetry/metrics/handles.rb +0 -44
- data/lib/opentelemetry/metrics/instruments.rb +0 -105
- data/lib/opentelemetry/metrics/meter.rb +0 -72
- data/lib/opentelemetry/metrics/meter_provider.rb +0 -22
- data/lib/opentelemetry/trace/propagation/trace_context/text_map_extractor.rb +0 -52
- data/lib/opentelemetry/trace/propagation/trace_context/text_map_injector.rb +0 -49
- data/lib/opentelemetry/trace/util/http_to_status.rb +0 -28
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright The OpenTelemetry Authors
|
4
|
-
#
|
5
|
-
# SPDX-License-Identifier: Apache-2.0
|
6
|
-
|
7
|
-
module OpenTelemetry
|
8
|
-
module Trace
|
9
|
-
module Util
|
10
|
-
# Convenience methods, not necessarily required by the API specification.
|
11
|
-
module HttpToStatus
|
12
|
-
# Maps numeric HTTP status codes to Trace::Status. This module is a mixin for Trace::Status
|
13
|
-
# and is not intended for standalone use.
|
14
|
-
#
|
15
|
-
# @param code Numeric HTTP status
|
16
|
-
# @return Status
|
17
|
-
def http_to_status(code)
|
18
|
-
case code.to_i
|
19
|
-
when 100..399
|
20
|
-
new(const_get(:OK))
|
21
|
-
else
|
22
|
-
new(const_get(:ERROR))
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|