Skip to content

Commit

Permalink
NH-93486: export traces using otlp
Browse files Browse the repository at this point in the history
  • Loading branch information
cleverchuk committed Nov 13, 2024
1 parent 88f18e2 commit 9ed3fb3
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider;
import io.opentelemetry.sdk.resources.Resource;
import io.opentelemetry.semconv.ResourceAttributes;

import java.util.function.BiConsumer;

@AutoService(ResourceProvider.class)
Expand All @@ -72,7 +71,8 @@ public Resource createResource(ConfigProperties configProperties) {
setIfNotNull(builder::put, ResourceAttributes.HOST_NAME, hostId.getHostname());
setIfNotNull(
builder::put, ResourceAttributes.CLOUD_AVAILABILITY_ZONE, hostId.getEc2AvailabilityZone());
setIfNotNull(builder::put, AttributeKey.stringKey("ec2.instance.id"), hostId.getEc2InstanceId());
setIfNotNull(
builder::put, AttributeKey.stringKey("ec2.instance.id"), hostId.getEc2InstanceId());

setIfNotNull(builder::put, ResourceAttributes.CONTAINER_ID, hostId.getDockerContainerId());
setIfNotNull(builder::put, ResourceAttributes.PROCESS_PID, (long) hostId.getPid());
Expand Down Expand Up @@ -116,8 +116,10 @@ public Resource createResource(ConfigProperties configProperties) {

HostId.AzureVmMetadata azureVmMetadata = hostId.getAzureVmMetadata();
if (azureVmMetadata != null) {
setIfNotNull(builder::put, AttributeKey.stringKey("azure.host.id"), azureVmMetadata.getHostId());
setIfNotNull(builder::put, AttributeKey.stringKey("azure.hostname"), azureVmMetadata.getHostName());
setIfNotNull(
builder::put, AttributeKey.stringKey("azure.host.id"), azureVmMetadata.getHostId());
setIfNotNull(
builder::put, AttributeKey.stringKey("azure.hostname"), azureVmMetadata.getHostName());
setIfNotNull(
builder::put, ResourceAttributes.CLOUD_PROVIDER, azureVmMetadata.getCloudProvider());

Expand Down

0 comments on commit 9ed3fb3

Please sign in to comment.