Skip to content
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

Several small bug fix #36

Merged
merged 9 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions aws-opentelemetry-distro/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ requires-python = ">=3.7"
dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.43b0",
"opentelemetry-distro == 0.43b0",
zzhlogin marked this conversation as resolved.
Show resolved Hide resolved
"opentelemetry-sdk ~= 1.13",
"opentelemetry-sdk-extension-aws ~= 2.0.1",
"opentelemetry-exporter-otlp-proto-grpc == 1.22.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
_OTelSDKConfigurator,
)
from opentelemetry.sdk.environment_variables import _OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED
from opentelemetry.sdk.extension.aws.resource.ec2 import AwsEc2ResourceDetector
from opentelemetry.sdk.extension.aws.resource.ecs import AwsEcsResourceDetector
from opentelemetry.sdk.extension.aws.resource.eks import AwsEksResourceDetector
from opentelemetry.sdk.metrics import MeterProvider
from opentelemetry.sdk.metrics._internal.instrument import (
Counter,
Expand All @@ -37,7 +40,7 @@
UpDownCounter,
)
from opentelemetry.sdk.metrics.export import AggregationTemporality, PeriodicExportingMetricReader
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.resources import Resource, get_aggregated_resources
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor, SpanExporter
from opentelemetry.sdk.trace.id_generator import IdGenerator
Expand Down Expand Up @@ -88,7 +91,14 @@ def _initialize_components(auto_instrumentation_version):
# populate version if using auto-instrumentation
if auto_instrumentation_version:
auto_resource[ResourceAttributes.TELEMETRY_AUTO_VERSION] = auto_instrumentation_version
resource = Resource.create(auto_resource)

resource = get_aggregated_resources(
[
AwsEc2ResourceDetector(),
AwsEksResourceDetector(),
AwsEcsResourceDetector(),
zzhlogin marked this conversation as resolved.
Show resolved Hide resolved
]
).merge(Resource.create(auto_resource))

_init_tracing(
exporters=trace_exporters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def build(self) -> AwsSpanMetricsProcessor:
error_histogram: Histogram = meter.create_histogram(_ERROR)
fault_histogram: Histogram = meter.create_histogram(_FAULT)
latency_histogram: Histogram = meter.create_histogram(_LATENCY, unit=_LATENCY_UNITS)
error_histogram.name = _ERROR
zzhlogin marked this conversation as resolved.
Show resolved Hide resolved
fault_histogram.name = _FAULT
latency_histogram.name = _LATENCY

return AwsSpanMetricsProcessor(
error_histogram, fault_histogram, latency_histogram, self._generator, self._resource
Expand Down
Loading