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

ref(spans): Remove the otel spans endpoint #3973

Merged
merged 4 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- No longer send COGS data to dedicated Kafka topic. ([#3953](https://github.com/getsentry/relay/pull/3953))
- Remove support for extrapolation of metrics. ([#3969](https://github.com/getsentry/relay/pull/3969))
- Remove the internal dashboard that shows logs and metrics. ([#3970](https://github.com/getsentry/relay/pull/3970))
- Remove the OTEL spans endpoint in favor of Envelopes. ([#3973](https://github.com/getsentry/relay/pull/3973))
- Allow creation of `SqliteEnvelopeBuffer` from config, and load existing stacks from db on startup. ([#3967](https://github.com/getsentry/relay/pull/3967))

## 24.8.0
Expand Down
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ pin-project-lite = "0.2.12"
pretty-hex = "0.3.0"
priority-queue = "2.0.3"
proc-macro2 = "1.0.8"
prost = "0.11.9"
psl = "2.1.33"
quote = "1.0.2"
r2d2 = "0.8.10"
Expand Down
1 change: 0 additions & 1 deletion relay-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ multer = { workspace = true }
once_cell = { workspace = true }
pin-project-lite = { workspace = true }
priority-queue = { workspace = true }
prost = { workspace = true }
rand = { workspace = true }
rayon = { workspace = true }
regex = { workspace = true }
Expand Down
2 changes: 0 additions & 2 deletions relay-server/src/endpoints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ mod nel;
mod project_configs;
mod public_keys;
mod security_report;
mod spans;
mod statics;
mod store;
mod unreal;
Expand Down Expand Up @@ -75,7 +74,6 @@ pub fn routes(config: &Config) -> Router<ServiceState>{
.route("/api/:project_id/minidump/", minidump::route(config))
.route("/api/:project_id/events/:event_id/attachments/", attachments::route(config))
.route("/api/:project_id/unreal/:sentry_key/", unreal::route(config))
.route("/api/:project_id/spans/", spans::route(config))
// NOTE: If you add a new (non-experimental) route here, please also list it in
// https://github.com/getsentry/sentry-docs/blob/master/docs/product/relay/operating-guidelines.mdx
.route_layer(middlewares::cors());
Expand Down
62 changes: 0 additions & 62 deletions relay-server/src/endpoints/spans.rs

This file was deleted.

8 changes: 4 additions & 4 deletions relay-server/src/services/processor/span/processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use relay_config::Config;
use relay_dynamic_config::{
CombinedMetricExtractionConfig, ErrorBoundary, Feature, GlobalConfig, ProjectConfig,
};
use relay_event_normalization::span::ai::extract_ai_measurements;
use relay_event_normalization::{
normalize_measurements, normalize_performance_score, span::tag_extraction, validate_span,
CombinedMeasurementsConfig, MeasurementsConfig, PerformanceScoreConfig, RawUserAgentInfo,
Expand All @@ -24,7 +25,8 @@ use relay_metrics::{MetricNamespace, UnixTimestamp};
use relay_pii::PiiProcessor;
use relay_protocol::{Annotated, Empty};
use relay_quotas::DataCategory;
use relay_spans::{otel_to_sentry_span, otel_trace::Span as OtelSpan};
use relay_spans::otel_trace::Span as OtelSpan;
use thiserror::Error;
use url::Host;

use crate::envelope::{ContentType, Item, ItemType};
Expand All @@ -35,8 +37,6 @@ use crate::services::processor::{
dynamic_sampling, ProcessEnvelopeState, ProcessingError, SpanGroup, TransactionGroup,
};
use crate::utils::{sample, ItemAction, ManagedEnvelope};
use relay_event_normalization::span::ai::extract_ai_measurements;
use thiserror::Error;

#[derive(Error, Debug)]
#[error(transparent)]
Expand Down Expand Up @@ -67,7 +67,7 @@ pub fn process(state: &mut ProcessEnvelopeState<SpanGroup>, global_config: &Glob
state.managed_envelope.retain_items(|item| {
let mut annotated_span = match item.ty() {
ItemType::OtelSpan => match serde_json::from_slice::<OtelSpan>(&item.payload()) {
Ok(otel_span) => Annotated::new(otel_to_sentry_span(otel_span)),
Ok(otel_span) => Annotated::new(relay_spans::otel_to_sentry_span(otel_span)),
Err(err) => {
relay_log::debug!("failed to parse OTel span: {}", err);
return ItemAction::Drop(Outcome::Invalid(DiscardReason::InvalidJson));
Expand Down
4 changes: 2 additions & 2 deletions relay-spans/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ chrono = { workspace = true }
hex = { workspace = true }
once_cell = { workspace = true }
opentelemetry-proto = { workspace = true, features = [
"gen-tonic",
"gen-tonic-messages",
"with-serde",
"trace",
] }
relay-event-schema = { workspace = true }
relay-protocol = { workspace = true }
serde_json = { workspace = true }

[dev-dependencies]
insta = { workspace = true }
serde_json = { workspace = true }
2 changes: 1 addition & 1 deletion relay-spans/src/span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ use std::str::FromStr;
use chrono::{TimeZone, Utc};
use opentelemetry_proto::tonic::common::v1::any_value::Value as OtelValue;
use opentelemetry_proto::tonic::common::v1::{AnyValue, KeyValue};
use relay_protocol::{Annotated, FromValue, Object};

use crate::otel_trace::{status::StatusCode as OtelStatusCode, Span as OtelSpan};
use crate::status_codes;
use relay_event_schema::protocol::{
EventId, MetricSummary, MetricsSummary, Span as EventSpan, SpanData, SpanId, SpanStatus,
Timestamp, TraceId,
};
use relay_protocol::{Annotated, FromValue, Object};

/// convert_from_otel_to_sentry_status returns a status as defined by Sentry based on the OTel status.
fn convert_from_otel_to_sentry_status(
Expand Down
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ flake8==7.0.0
confluent-kafka==2.1.1
flask==3.0.3
msgpack==1.0.7
opentelemetry-proto==1.22.0
pytest-localserver==0.8.1
pytest-sentry==0.3.0
pytest-xdist==3.5.0
Expand Down
27 changes: 0 additions & 27 deletions tests/integration/fixtures/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,33 +203,6 @@ def send_nel_event(

return

def send_otel_span(
self,
project_id,
json=None,
bytes=None,
headers=None,
dsn_key_idx=0,
dsn_key=None,
):

if dsn_key is None:
dsn_key = self.get_dsn_public_key(project_id, dsn_key_idx)

url = f"/api/{project_id}/spans/?sentry_key={dsn_key}"

if json:
headers = {
"Content-Type": "application/json",
**(headers or {}),
}

response = self.post(url, headers=headers, json=json)
else:
response = self.post(url, headers=headers, data=bytes)

response.raise_for_status()

def send_options(self, project_id, headers=None, dsn_key_idx=0):
headers = {
"X-Sentry-Auth": self.get_auth_header(project_id, dsn_key_idx),
Expand Down
Loading
Loading