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

Added OpenTelemetry REST endpoint for external systems to store logs in Salesforce #767

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

jongpie
Copy link
Owner

@jongpie jongpie commented Sep 18, 2024

Resolved #635 by adding a new LoggerRestResource Apex class that can be called by external systems to store external logging data in Salesforce, using OpenTelemetry's logs data model.

For now, this only includes the ability to store logging data, and only a handful of attributes are supported. Future releases will include:

  • Support for populating more attributes, which will then be stored in mapped fields in Log__c and LogEntry__c
  • Support for more HTTP verbs & endpoints: I started working on adding other endpoints, like a GET endpoint that could be used to also retrieve logging data from Salesforce in OpenTelemetry (OTel) format, but the complexity was growing with that effort, so I'll revisit it in a separate PR/release

@jongpie jongpie added Type: Enhancement New feature or request Layer: Log Management Items related to the custom objects & Logger Console app Layer: Logger Engine Items related to the core logging engine Logging Source: API Items related to using Nebula Logger via REST API Feature: OpenTelemetry Support Items to related to supporting OpenTelemetry (OTel) and its standards for observability data labels Sep 18, 2024
@jongpie jongpie temporarily deployed to Advanced Scratch Org September 18, 2024 14:24 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Event Monitoring Scratch Org September 18, 2024 14:24 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to OmniStudio Scratch Org September 18, 2024 14:37 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Platform Cache Scratch Org September 18, 2024 14:38 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Experience Cloud Scratch Org September 18, 2024 14:50 — with GitHub Actions Inactive
@jongpie jongpie force-pushed the feature/logger-rest-resource branch from c01b013 to 2d5e814 Compare September 20, 2024 02:48
@jongpie jongpie temporarily deployed to Advanced Scratch Org September 20, 2024 02:52 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Event Monitoring Scratch Org September 20, 2024 02:52 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Platform Cache Scratch Org September 20, 2024 03:05 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to OmniStudio Scratch Org September 20, 2024 03:08 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Experience Cloud Scratch Org September 20, 2024 03:13 — with GitHub Actions Inactive
…external systems to store logging data in Salesforce, using OpenTelemetry's logs data model
…apped traceId to transactionId, and added more attributes for browser fields, HttpRequest fields, and HttpResponse fields
@jongpie jongpie force-pushed the feature/logger-rest-resource branch from 476eee8 to 2d224d2 Compare December 30, 2024 04:22
@jongpie jongpie force-pushed the feature/logger-rest-resource branch from 2d224d2 to f0c63df Compare December 30, 2024 04:25
@jongpie jongpie deployed to Advanced Scratch Org December 30, 2024 04:30 — with GitHub Actions Active
@jongpie jongpie deployed to Event Monitoring Scratch Org December 30, 2024 04:30 — with GitHub Actions Active
@jongpie jongpie deployed to Platform Cache Scratch Org December 30, 2024 04:42 — with GitHub Actions Active
@jongpie jongpie deployed to Experience Cloud Scratch Org December 30, 2024 04:45 — with GitHub Actions Active
@jongpie jongpie temporarily deployed to Base Scratch Org December 30, 2024 05:33 — with GitHub Actions Inactive
@jongpie jongpie deployed to OmniStudio Scratch Org December 30, 2024 05:45 — with GitHub Actions Active
@jongpie jongpie temporarily deployed to Base Scratch Org December 30, 2024 06:02 — with GitHub Actions Inactive
@jongpie jongpie deployed to Base Scratch Org December 30, 2024 06:14 — with GitHub Actions Active
Copy link

codecov bot commented Dec 30, 2024

Codecov Report

Attention: Patch coverage is 92.37537% with 26 lines in your changes missing coverage. Please review.

Project coverage is 91.51%. Comparing base (daf14e9) to head (f0c63df).

Files with missing lines Patch % Lines
...main/log-management/classes/LoggerRestResource.cls 92.21% 26 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #767      +/-   ##
==========================================
+ Coverage   85.97%   91.51%   +5.53%     
==========================================
  Files          17       59      +42     
  Lines        1319     6609    +5290     
  Branches      200      200              
==========================================
+ Hits         1134     6048    +4914     
- Misses        165      541     +376     
  Partials       20       20              
Flag Coverage Δ
Apex 92.89% <92.35%> (?)
LWC 85.97% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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 Layer: Log Management Items related to the custom objects & Logger Console app Layer: Logger Engine Items related to the core logging engine Logging Source: API Items related to using Nebula Logger via REST API Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an Apex RestResource class to provide logging capabilities to external inbound integrations
2 participants