# OpenTelemetry with Salesforce - is it working with Dynatrace?

**URL:** <https://community.dynatrace.com/t/opentelemetry-with-salesforce-is-it-working-with-dynatrace/40276>\
**Category:** OpenTelemetry\
**Tags:** distributed-traces-classic, opentelemetry, salesforce\
**Created:** [June 19, 2023, 7:28pm UTC](https://community.dynatrace.com/t/opentelemetry-with-salesforce-is-it-working-with-dynatrace/40276 "2023-06-19T19:28:10Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Slawa](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Slawa](https://community.dynatrace.com/u/Slawa)\
**Post date:** [June 19, 2023, 7:28pm UTC](https://community.dynatrace.com/t/opentelemetry-with-salesforce-is-it-working-with-dynatrace/40276/1 "2023-06-19T19:28:10Z")

</div>

I am looking for an example implementation of Opentelemetry with Partner Hub/ Customer Hub.

there are 2 links where this possibility is declared:

> **[5 Design Patterns for Building Observable Services - Salesforce Engineering Blog](https://engineering.salesforce.com/5-design-patterns-for-building-observable-services-d56e7a330419/)**
>
> There are three categories of monitoring design patterns that can help solve commonly occurring problems in software development.

> **[Anomaly Detection in Zipkin Trace Data - Salesforce Engineering Blog](https://engineering.salesforce.com/anomaly-detection-in-zipkin-trace-data-87c8a2ded8a1/)**
>
> Using machine learning for deep analysis of span data

And here it was RFE submitted:  
[https://ideas.salesforce.com/s/idea/a0B8W00000GdYP7UAN/improve-traceability-of-api-requests-in-end2end-crossplatform-processes](https://ideas.salesforce.com/s/idea/a0B8W00000GdYP7UAN/improve-traceability-of-api-requests-in-end2end-crossplatform-processes)

But will it work with Dynatrace?  
(Indeed we are **not** going to buy SF-shield and Dyna SF plugin)

---

<div class="post-metadata">

**Author:** ![ben\_wrightson](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ben_wrightson/32/34776_2.png) [@ben\_wrightson](https://community.dynatrace.com/u/ben_wrightson)\
**Post date:** [June 22, 2023, 4:19pm UTC](https://community.dynatrace.com/t/opentelemetry-with-salesforce-is-it-working-with-dynatrace/40276/2 "2023-06-22T16:19:34Z")

</div>

I’m a bit confused as to what is the question here.

The first link describes general design patterns / best practices for software development. The second one describes how Salesforce works with their traces internally. The third is an RFE that would allow connecting observability data inside Salesforce with observability data outside of Salesforce.  
Please correct me if I’m reading that incorrectly.

You can ingest OpenTelemetry data into Dynatrace [of course](https://www.dynatrace.com/support/help/shortlink/opentelemetry). If I understand your question correctly, you would like to ingest the trace data Salesforce collects into Dynatrace.

From my experience, the hurdles for such a setup usually are not so much technical as they are commercial - OpenTelemetry data from a SaaS platform could allow valuable insights into the SaaS platform, but could also expose technical data from that platform which may be considered trade secrets. So you’d have to discuss that with Salesforce first.

---

<div class="post-metadata">

**Author:** ![Slawa](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Slawa](https://community.dynatrace.com/u/Slawa)\
**Post date:** [June 22, 2023, 6:44pm UTC](https://community.dynatrace.com/t/opentelemetry-with-salesforce-is-it-working-with-dynatrace/40276/3 "2023-06-22T18:44:02Z")

</div>

“You can ingest OpenTelemetry data into Dynatrace&nbsp;[of course](https://www.dynatrace.com/support/help/shortlink/opentelemetry).”

Sorry but do you have successful proof, or is this just “theoretical”?

We failed. The default aura API has dead-end info SF - all traces, headers are wiped out.

---

<div class="post-metadata">

**Author:** ![estebancortes](https://avatars.discourse-cdn.com/v4/letter/e/848f3c/32.png) [@estebancortes](https://community.dynatrace.com/u/estebancortes)\
**Post date:** [June 23, 2023, 4:25am UTC](https://community.dynatrace.com/t/opentelemetry-with-salesforce-is-it-working-with-dynatrace/40276/4 "2023-06-23T04:25:42Z")

</div>

Hi Slawa, Dynatrace support traces ingested by Open Telemetry, please refer to docs here. [OpenTelemetry and Dynatrace — Dynatrace Docs](https://www.dynatrace.com/support/help/extend-dynatrace/opentelemetry)

That being said, Salesforce or whichever source of traces you are working with that is compatible with Otel should be able to communicate with Dynatrace.

---

<div class="post-metadata">

**Author:** ![ben\_wrightson](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ben_wrightson/32/34776_2.png) [@ben\_wrightson](https://community.dynatrace.com/u/ben_wrightson)\
**Post date:** [June 23, 2023, 2:12pm UTC](https://community.dynatrace.com/t/opentelemetry-with-salesforce-is-it-working-with-dynatrace/40276/5 "2023-06-23T14:12:43Z")

</div>

No, this is not theoretical. I know it works because I’ve seen it work (NB: Not with data from Salesforce).

However, I still think there is a misunderstanding.

Dynatrace can ingest OpenTelemetry data; OpenTelemetry is a standard (independent of vendors like Salesforce). What I don’t know is whether Salesforce will provide that data to customers. I haven’t found anywhere in the articles where it says they do that (they say they use it internally, but that doesn’t mean that you can access that data from the outside).  
I also wouldn’t be surprised if they didn’t expose that data publicly.

---

<div class="post-metadata">

**Author:** ![Slawa](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Slawa](https://community.dynatrace.com/u/Slawa)\
**Post date:** [June 23, 2023, 6:46pm UTC](https://community.dynatrace.com/t/opentelemetry-with-salesforce-is-it-working-with-dynatrace/40276/6 "2023-06-23T18:46:26Z")

</div>

AFAIK - you don’t have hands-on experience with the Salesforce platform + Open telemetry.  
But I am looking exactly a success case to not waste time.

---

<div class="post-metadata">

**Author:** ![ben\_wrightson](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ben_wrightson/32/34776_2.png) [@ben\_wrightson](https://community.dynatrace.com/u/ben_wrightson)\
**Post date:** [June 26, 2023, 3:10pm UTC](https://community.dynatrace.com/t/opentelemetry-with-salesforce-is-it-working-with-dynatrace/40276/7 "2023-06-26T15:10:13Z")

</div>

[@Slawa](https://community.dynatrace.com/user/60907)&nbsp;  
What I’ve been trying to tell you is that I don’t believe Salesforce exposes their OpenTelemetry data publicly, so until I see information to the contrary I believe an integration will not be possible.

---

<div class="post-metadata">

**Author:** ![alexander\_dt](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@alexander\_dt](https://community.dynatrace.com/u/alexander_dt)\
**Post date:** [June 28, 2023, 8:10am UTC](https://community.dynatrace.com/t/opentelemetry-with-salesforce-is-it-working-with-dynatrace/40276/8 "2023-06-28T08:10:02Z")

</div>

[@Slawa](https://community.dynatrace.com/user/60907), I second what&nbsp;[@ben\_wrightson](https://community.dynatrace.com/user/937) wrote, the question is not entirely clear to me either, I am afraid.

Are you asking if you can ingest OpenTelemetry data with Dynatrace? If so, yes, absolutely. You can find more information on the OTLP specifics at&nbsp;[OpenTelemetry and Dynatrace — Dynatrace Docs](https://www.dynatrace.com/support/help/shortlink/opentelemetry-otlp). Please do note, Dynatrace currently only supports binary-encoded messages on HTTPS.

If your setup uses technology listed at&nbsp;[Use OneAgent with OpenTelemetry data — Dynatrace Docs](https://www.dynatrace.com/support/help/shortlink/opentelemetry-oneagent),&nbsp;you could also use OneAgent to have it automatically ingested.

However, that all requires that your platform does create and emit the necessary OpenTelemetry signals.

---

<div class="post-metadata">

**Author:** ![Slawa](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@Slawa](https://community.dynatrace.com/u/Slawa)\
**Post date:** [June 28, 2023, 11:22am UTC](https://community.dynatrace.com/t/opentelemetry-with-salesforce-is-it-working-with-dynatrace/40276/9 "2023-06-28T11:22:34Z")

</div>

Sorry, maybe I mislead  
The question was **only** for people who had&nbsp; **hands-on** experience with Salesforce + Dynatrace.  
Will it works E2E or not? From&nbsp;&nbsp; **hands-on** experience.  
Please ignore this topic.  
No theory, no one agent (who works with SF - knows that in SaaS that’s not possible, only PaaS Heroku with the limitation for traces)

---

<div class="post-metadata">

**Author:** ![cullinflynn](https://avatars.discourse-cdn.com/v4/letter/c/c68b51/32.png) [@cullinflynn](https://community.dynatrace.com/u/cullinflynn)\
**Post date:** [February 17, 2025, 8:15pm UTC](https://community.dynatrace.com/t/opentelemetry-with-salesforce-is-it-working-with-dynatrace/40276/10 "2025-02-17T20:15:21Z")

</div>

Hi&nbsp;[@Slawa](https://community.dynatrace.com/user/60907),

I am also working on a solution to ingest enterprise Salesforce data into Dynatrace. Have you found any solutions here?

Thanks,

Cullin

---

<div class="post-metadata">

**Author:** ![gopher](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gopher/32/5728_2.png) [@gopher](https://community.dynatrace.com/u/gopher)\
**Post date:** [February 18, 2025, 2:02am UTC](https://community.dynatrace.com/t/opentelemetry-with-salesforce-is-it-working-with-dynatrace/40276/11 "2025-02-18T02:02:43Z")

</div>

[@Slawa](https://community.dynatrace.com/user/60907)&nbsp;, if you are not going to purchase the available plugins, then your options are limited.

you’re not really providing much about what you have in Sales Force, so here’s a generic answer.  
&nbsp;  
Only relevant if you have custom apps.  
You can use Apex to create custom HTTP callouts to send traces or custom events to Dynatrace.

This will involve:  
Creating a HTTP Callout to Dynatrace&nbsp;by using Apex to make a HTTP callout to the Dynatrace API endpoint.  
you’ll need an apex class sort of like the below.

```cpp
public class DynatraceIntegration {

    // The endpoint for Dynatrace custom events API
    private static final String DYNATRACE_API_URL = 'https://{environmentid}.live.dynatrace.com/api/v1/events';
    private static final String DYNATRACE_API_TOKEN = 'YOUR_DYNATRACE_API_TOKEN';

    public static void sendCustomEvent(String eventName, String eventDetails) {
        // Prepare the request headers
        Map<String, String> headers = new Map<String, String>();
        headers.put('Authorization', 'Api-Token ' + DYNATRACE_API_TOKEN);
        headers.put('Content-Type', 'application/json');

        // Prepare the request body
        String body = '{"eventType":"CUSTOM","title":"' + eventName + '","description":"' + eventDetails + '","source":"Salesforce Apex","customProperties":{"salesforceEvent":"true"}}';

        // Send the HTTP request to Dynatrace
        HttpRequest req = new HttpRequest();
        req.setEndpoint(DYNATRACE_API_URL);
        req.setMethod('POST');
        req.setHeaders(headers);
        req.setBody(body);

        Http http = new Http();
        HttpResponse res = http.send(req);

        // Log the response
        System.debug('Dynatrace Response: ' + res.getBody());
    }
}

```

You can then trigger this class when specific events occur in your Salesforce environment.

```markup
// Trigger this in your Apex logic when an event occurs
DynatraceIntegration.sendCustomEvent('Record Updated', 'Salesforce record has been updated successfully.');

```

If you don’t have a custom App, then the only other option is to us the SF API to get events into Dynatrace.  
This will involve you creating a custom integration:&nbsp;&nbsp;[Dynatrace Extensions Python SDK — Dynatrace Docs](https://docs.dynatrace.com/docs/ingest-from/extensions20/data-sources/python)  
based on your own version of:&nbsp;[Salesforce Extension monitoring & observability | Dynatrace Hub](https://www.dynatrace.com/hub/detail/salesforce-event-streaming-v2/?query=salesforce&filter=all)

This will allow you go get events based on API calls, user actions, or login events. You would need to host this on a local Active Gate and pull the data.

The RUM components, you can just rip off the extension steps.

Anyway, have fun building your own solution.
