OpsCanary
observabilityopentelemetryPractitioner

Securing OpenTelemetry in Legacy Systems: Best Practices

5 min read OpenTelemetry BlogMay 19, 2026Reviewed for accuracy
Share
PractitionerHands-on experience recommended

In today's world, observability is critical, especially in legacy environments where direct security measures may not be feasible. Applying OpenTelemetry security practices allows you to create a robust telemetry pipeline that acts as a control point, ensuring that data flows are secure and trustworthy. This is vital for maintaining operational integrity and compliance in complex systems.

The OpenTelemetry Collector operates outside the legacy system boundary, running on a separate host, VM, or container. This separation is crucial as it allows you to constrain ingestion points and classify data by source trust level. By isolating bridging components and minimizing exposed components, you can enforce a Zero Trust approach, where access is explicitly controlled rather than assumed safe based on network location. For example, you can use processors to hash user IDs and redact sensitive information, ensuring that only necessary data is exposed. Here’s a snippet that shows how to hash user IDs:

processors:
1transform/hash_user:
2    trace_statements:
3      - context:
4          span:
5        statements:
6          - set(attributes["user.hash"], SHA256(attributes["user.id"]))
7          - delete_key(attributes, "user.id")

In production, the key is to maintain a balance between observability and security. You need to be aware of the potential pitfalls, such as misconfigurations that could expose sensitive data. The versioning of OpenTelemetry is also important; staying updated ensures you benefit from the latest security features and fixes. Implementing strict redaction policies can further safeguard your telemetry data:

processors:
1redaction/strict:
2    allow_all_keys: false
3    allowed_keys:
4      - id
5      - name
6      - status

Key takeaways

  • Utilize the OpenTelemetry Collector to separate telemetry from legacy systems.
  • Enforce Zero Trust principles by constraining data flows and access.
  • Implement data classification based on source trust levels.
  • Use processors to hash sensitive user information before transmission.
  • Apply strict redaction policies to limit exposed telemetry data.

Why it matters

In production, securing telemetry data is essential to prevent leaks and maintain compliance. A well-implemented OpenTelemetry pipeline can significantly reduce the risk of data exposure in legacy environments.

Code examples

processors
1processors:
2  transform/hash_user:
3    trace_statements:
4      - context:
5          span:
6        statements:
7          - set(attributes["user.hash"], SHA256(attributes["user.id"]))
8          - delete_key(attributes, "user.id")
processors
1processors:
2  redaction/strict:
3    allow_all_keys: false
4    allowed_keys:
5      - id
6      - name
7      - status

When NOT to use this

The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.

Want the complete reference?

Read official docs

Test what you just learned

Quiz questions written from this article

Take the quiz →
DigitalOcean Serverless InferenceSponsor

OpenAI & Anthropic-compatible inference API — no GPU provisioning needed. 55+ models, pay-per-token with no minimums. VPC + zero data retention by default.

Try Serverless Inference →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.