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

OpenTelemetry support #466

Open
RaviVaranasi opened this issue Mar 21, 2023 · 9 comments
Open

OpenTelemetry support #466

RaviVaranasi opened this issue Mar 21, 2023 · 9 comments
Labels
Feature: OpenTelemetry Support Items to related to supporting OpenTelemetry (OTel) and its standards for observability data Type: Enhancement New feature or request

Comments

@RaviVaranasi
Copy link

New Feature Summary

Can I ship logs to DataDog instead of logging inside Salesforce? The advantage is to have one logging system across multiple systems

@RaviVaranasi RaviVaranasi added the Type: Enhancement New feature or request label Mar 21, 2023
@jamessimone
Copy link
Collaborator

jamessimone commented Mar 21, 2023

@RaviVaranasi I would look at the Slack plugin for the canonical way to publish log entries off-platform (as far as architecture is concerned; this isn't to say that you must send log entries to Slack if they're going off-platform, just that the way that this plugin is built should answer the question of "how to do this.")

I'm sure @jongpie can add additional info - and perhaps an official DataDog plugin can also be supported - but if you're looking to build out this functionality and the question is just "is it possible," the architecture in the Slack plugin should be enough to get going!

@RaviVaranasi
Copy link
Author

Thanks for the feedback. If we ship the logs to DataDog, can we not create Log objects in SF?

@jamessimone
Copy link
Collaborator

You still can!

@jongpie
Copy link
Owner

jongpie commented Mar 23, 2023

@RaviVaranasi I've previously done some integrations other tools like Loggly, but I haven't used Datadog myself before, so I'm not familiar with their API or how to best integrate with them. But to expand on what @jamessimone has said, I think there are 2-3 ways you could approach this type of integration:

Option 1: Create a Nebula Logger plugin that sends Log__c and LogEntry__c data to Datadog

As @jamessimone pointed out, the Slack plugin is a great example of how plugins for Nebula Logger are structured. This plugin in particular also leverages Log__c and LogEntry__c data, so if you want to still store data in Salesforce (in addition to storing it in Datadog), then I would mimic the Slack plugin's approach

  • Pro: this approach would keep your existing usage of Nebula Logger the same, the plugin would just be an additional async job that sends data from the custom objects to Datadog
  • Con: this will continue to use your org's data storage in the custom objects Log__c and LogEntry__c

Option 2: Create a Nebula Logger plugin that can be configured to send either LogEntryEvent__e or Log__c/LogEntry__c data to Datadog

If you're worried about the storage usage of the custom objects in your org, and you want to control if some or all Nebula Logger instead goes just to Datadog, then you can take a look at the Big Object Archiving plugin. The Big Object Archiving plugin lets you choose per user if Nebula Logger's LogEntryEvent__e data is stored in Log__c/LogEntry__c, or only stored in a custom big object (LogEntryArchive__b). You could have a similar plugin for Datadog that lets you control per user if logging data is stored in Salesforce, Datadog, or both

  • Pro: this approach let you decide per user if their logging data lives in Salesforce and/or Datadog
  • Con: this would be the most complex option to implement

Option 3: Don't Create a Nebula Logger plugin at all - instead, integrate using pub/sub API

I'm not sure what's involved with setting up this option (because I haven't used Datadog before), but since Nebula Logger uses platform events to create LogEntryEvent__e data, you can probably setup Datadog to subscribe directly to LogEntryEvent__e object using the pub/sub API.

  • Pro: this approach would not require creating a Nebula Logger plugin (as far as I'm aware) - this would be configured directly in Datadog (assuming they support it)
  • Con: external pub/sub subscribers count towards your org's daily limits for platform event allocations - so if you have a lot of logging occurring in your org, this could cause you to exceed your limits

Hope this helps, but let us know if you have questions!

@sjurgis
Copy link

sjurgis commented Apr 27, 2023

@jongpie any chance you know any resources / examples how to log apex metrics (mostly around performance)?

@sjurgis
Copy link

sjurgis commented Apr 27, 2023

FWIW Datadog does have a connector for Event Monitoring https://docs.datadoghq.com/integrations/salesforce/

@RaviVaranasi
Copy link
Author

FWIW Datadog does have a connector for Event Monitoring https://docs.datadoghq.com/integrations/salesforce/

Does this do logging?

@jonathankretzmer
Copy link

Instead of actively targeting a single provider like DataDog, it would possibly be more beneficial to target an open standard, e.g. OpenTelemetry (which DataDog supports).

@jongpie
Copy link
Owner

jongpie commented May 24, 2023

@jonathankretzmer I agree, I think it makes more sense to target the OpenTelemetry standard, instead of vendor-specific integrations. There was recently a discussion about this too, so I think a lot of people would benefit from using OpenTelemetry. I've started some initial analysis & prototyping on this already - I'm hoping to work on it more over the next several weeks.

@jongpie jongpie added External Tools Feature: OpenTelemetry Support Items to related to supporting OpenTelemetry (OTel) and its standards for observability data labels May 24, 2023
@jongpie jongpie changed the title DataDog support OpenTelemetry support Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: OpenTelemetry Support Items to related to supporting OpenTelemetry (OTel) and its standards for observability data Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants