Skip to content

Commit

Permalink
Merge branch 'main' into support-otel-attribute-count-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
owais committed Sep 25, 2021
2 parents fb31e74 + 3cee4ef commit 0b42002
Show file tree
Hide file tree
Showing 17 changed files with 70 additions and 24 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#2096](https://github.com/open-telemetry/opentelemetry-python/pull/2096))
- Fix propagation bug caused by counting skipped entries
([#2071](https://github.com/open-telemetry/opentelemetry-python/pull/2071))
- Add entry point for exporters with default protocol
([#2093](https://github.com/open-telemetry/opentelemetry-python/pull/2093))
- Do not skip sequence attribute on decode error
([#2097](https://github.com/open-telemetry/opentelemetry-python/pull/2097))
- `opentelemetry-test`: Add `HttpTestBase` to allow tests with actual TCP sockets
Expand All @@ -20,6 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#2103](https://github.com/open-telemetry/opentelemetry-python/pull/2103))
- Add support for OTEL_ATTRIBUTE_COUNT_LIMIT
([#2139](https://github.com/open-telemetry/opentelemetry-python/pull/2139))
- `opentelemetry-exporter-otlp`: Add `opentelemetry-otlp-proto-http` as dependency
- ([#2147](https://github.com/open-telemetry/opentelemetry-python/pull/2147))

## [1.5.0-0.24b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.5.0-0.24b0) - 2021-08-26

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ where = src
test =

[options.entry_points]
opentelemetry_exporter =
opentelemetry_traces_exporter =
jaeger_proto = opentelemetry.exporter.jaeger.proto.grpc:JaegerExporter
4 changes: 2 additions & 2 deletions exporter/opentelemetry-exporter-jaeger-thrift/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ where = src
test =

[options.entry_points]
opentelemetry_exporter =
jaeger_thrift = opentelemetry.exporter.jaeger.thrift:JaegerExporter
opentelemetry_traces_exporter =
jaeger_thrift = opentelemetry.exporter.jaeger.thrift:JaegerExporter
4 changes: 4 additions & 0 deletions exporter/opentelemetry-exporter-jaeger/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,7 @@ install_requires =

[options.extras_require]
test =

[options.entry_points]
opentelemetry_traces_exporter =
jaeger = opentelemetry.exporter.jaeger.proto.grpc:JaegerExporter
4 changes: 2 additions & 2 deletions exporter/opentelemetry-exporter-opencensus/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ where = src
test =

[options.entry_points]
opentelemetry_exporter =
opencensus = opentelemetry.exporter.opencensus.trace_exporter:OpenCensusSpanExporter
opentelemetry_traces_exporter =
opencensus = opentelemetry.exporter.opencensus.trace_exporter:OpenCensusSpanExporter
4 changes: 2 additions & 2 deletions exporter/opentelemetry-exporter-otlp-proto-grpc/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ test =
where = src

[options.entry_points]
opentelemetry_exporter =
otlp_proto_grpc_span = opentelemetry.exporter.otlp.proto.grpc.trace_exporter:OTLPSpanExporter
opentelemetry_traces_exporter =
otlp_proto_grpc = opentelemetry.exporter.otlp.proto.grpc.trace_exporter:OTLPSpanExporter
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
OTEL_EXPORTER_OTLP_TRACES_HEADERS,
OTEL_EXPORTER_OTLP_TRACES_TIMEOUT,
)
from opentelemetry.sdk.trace import Span as ReadableSpan
from opentelemetry.sdk.trace import ReadableSpan
from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult
from opentelemetry.trace import StatusCode

Expand Down
4 changes: 2 additions & 2 deletions exporter/opentelemetry-exporter-otlp-proto-http/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ test =
where = src

[options.entry_points]
opentelemetry_exporter =
otlp_proto_http_span = opentelemetry.exporter.otlp.proto.http.trace_exporter:OTLPSpanExporter
opentelemetry_traces_exporter =
otlp_proto_http = opentelemetry.exporter.otlp.proto.http.trace_exporter:OTLPSpanExporter
5 changes: 5 additions & 0 deletions exporter/opentelemetry-exporter-otlp/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ python_requires = >=3.6
packages=find_namespace:
install_requires =
opentelemetry-exporter-otlp-proto-grpc == 1.5.0
opentelemetry-exporter-otlp-proto-http == 1.5.0

[options.entry_points]
opentelemetry_traces_exporter =
otlp = opentelemetry.exporter.otlp.proto.grpc.trace_exporter:OTLPSpanExporter
4 changes: 2 additions & 2 deletions exporter/opentelemetry-exporter-zipkin-json/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ where = src
test =

[options.entry_points]
opentelemetry_exporter =
zipkin_json = opentelemetry.exporter.zipkin.json:ZipkinExporter
opentelemetry_traces_exporter =
zipkin_json = opentelemetry.exporter.zipkin.json:ZipkinExporter
4 changes: 2 additions & 2 deletions exporter/opentelemetry-exporter-zipkin-proto-http/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ where = src
test =

[options.entry_points]
opentelemetry_exporter =
zipkin_proto = opentelemetry.exporter.zipkin.proto.http:ZipkinExporter
opentelemetry_traces_exporter =
zipkin_proto = opentelemetry.exporter.zipkin.proto.http:ZipkinExporter
4 changes: 4 additions & 0 deletions exporter/opentelemetry-exporter-zipkin/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ install_requires =

[options.extras_require]
test =

[options.entry_points]
opentelemetry_traces_exporter =
zipkin = opentelemetry.exporter.zipkin.proto.http:ZipkinExporter
4 changes: 2 additions & 2 deletions opentelemetry-sdk/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ where = src
[options.entry_points]
opentelemetry_tracer_provider =
sdk_tracer_provider = opentelemetry.sdk.trace:TracerProvider
opentelemetry_exporter =
console_span = opentelemetry.sdk.trace.export:ConsoleSpanExporter
opentelemetry_traces_exporter =
console = opentelemetry.sdk.trace.export:ConsoleSpanExporter
opentelemetry_id_generator =
random = opentelemetry.sdk.trace.id_generator:RandomIdGenerator

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def _import_exporters(
exporter_name,
exporter_impl,
) in _import_tracer_provider_config_components(
exporter_names, "opentelemetry_exporter"
exporter_names, "opentelemetry_traces_exporter"
):
if issubclass(exporter_impl, SpanExporter):
trace_exporters[exporter_name] = exporter_impl
Expand Down
8 changes: 6 additions & 2 deletions opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,12 @@ def __init__(
)

# attribute count
global_max_attributes = self._from_env_if_absent(max_attributes, OTEL_ATTRIBUTE_COUNT_LIMIT)
self.max_attributes = global_max_attributes or _DEFAULT_OTEL_ATTRIBUTE_COUNT_LIMIT
global_max_attributes = self._from_env_if_absent(
max_attributes, OTEL_ATTRIBUTE_COUNT_LIMIT
)
self.max_attributes = (
global_max_attributes or _DEFAULT_OTEL_ATTRIBUTE_COUNT_LIMIT
)

self.max_span_attributes = self._from_env_if_absent(
max_span_attributes,
Expand Down
34 changes: 29 additions & 5 deletions opentelemetry-sdk/tests/trace/test_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,16 @@ def test_limits_attribute_length_limits_code(self):
self.assertEqual(limits.max_span_attribute_length, 33)

def test_limits_values_code(self):
max_attributes, max_span_attributes, max_link_attributes, max_event_attributes, max_events, max_links, max_attr_length, max_span_attr_length = (
(
max_attributes,
max_span_attributes,
max_link_attributes,
max_event_attributes,
max_events,
max_links,
max_attr_length,
max_span_attr_length,
) = (
randint(0, 10000),
randint(0, 10000),
randint(0, 10000),
Expand All @@ -1397,10 +1406,21 @@ def test_limits_values_code(self):
self.assertEqual(limits.max_event_attributes, max_event_attributes)
self.assertEqual(limits.max_link_attributes, max_link_attributes)
self.assertEqual(limits.max_attribute_length, max_attr_length)
self.assertEqual(limits.max_span_attribute_length, max_span_attr_length)
self.assertEqual(
limits.max_span_attribute_length, max_span_attr_length
)

def test_limits_values_env(self):
max_attributes, max_span_attributes, max_link_attributes, max_event_attributes, max_events, max_links, max_attr_length, max_span_attr_length = (
(
max_attributes,
max_span_attributes,
max_link_attributes,
max_event_attributes,
max_events,
max_links,
max_attr_length,
max_span_attr_length,
) = (
randint(0, 10000),
randint(0, 10000),
randint(0, 10000),
Expand All @@ -1420,7 +1440,9 @@ def test_limits_values_env(self):
OTEL_SPAN_EVENT_COUNT_LIMIT: str(max_events),
OTEL_SPAN_LINK_COUNT_LIMIT: str(max_links),
OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT: str(max_attr_length),
OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: str(max_span_attr_length),
OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: str(
max_span_attr_length
),
},
):
limits = trace.SpanLimits()
Expand All @@ -1431,7 +1453,9 @@ def test_limits_values_env(self):
self.assertEqual(limits.max_event_attributes, max_event_attributes)
self.assertEqual(limits.max_link_attributes, max_link_attributes)
self.assertEqual(limits.max_attribute_length, max_attr_length)
self.assertEqual(limits.max_span_attribute_length, max_span_attr_length)
self.assertEqual(
limits.max_span_attribute_length, max_span_attr_length
)

@mock.patch.dict(
"os.environ",
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ exclude = '''
(
/( # generated files
.tox|
venv|
exporter/opentelemetry-exporter-jaeger-proto-grpc/src/opentelemetry/exporter/jaeger/proto/grpc/gen|
exporter/opentelemetry-exporter-jaeger-thrift/src/opentelemetry/exporter/jaeger/thrift/gen|
exporter/opentelemetry-exporter-zipkin-proto-http/src/opentelemetry/exporter/zipkin/proto/http/v2/gen|
Expand Down

0 comments on commit 0b42002

Please sign in to comment.