-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
65 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from typing import Any, Callable, Mapping, Tuple | ||
|
||
from google.protobuf.message import Message as ProtobufMessage | ||
from sentry_protos.snuba.v1alpha.endpoint_aggregate_bucket_pb2 import ( | ||
AggregateBucketRequest, | ||
) | ||
from sentry_protos.snuba.v1alpha.endpoint_span_samples_pb2 import SpanSamplesRequest | ||
from sentry_protos.snuba.v1alpha.endpoint_tags_list_pb2 import ( | ||
AttributeValuesRequest, | ||
TraceItemAttributesRequest, | ||
) | ||
|
||
from snuba.utils.metrics.timer import Timer | ||
from snuba.web.rpc.v1alpha.span_samples import span_samples_query | ||
from snuba.web.rpc.v1alpha.timeseries import timeseries_query | ||
from snuba.web.rpc.v1alpha.trace_item_attribute_list import ( | ||
trace_item_attribute_list_query, | ||
) | ||
from snuba.web.rpc.v1alpha.trace_item_attribute_values import ( | ||
trace_item_attribute_values_query, | ||
) | ||
|
||
Version = str | ||
EndpointName = str | ||
|
||
ALL_RPCS: Mapping[ | ||
Version, | ||
Mapping[ | ||
EndpointName, | ||
Tuple[Callable[[Any, Timer], ProtobufMessage], type[ProtobufMessage]], | ||
], | ||
] = { | ||
"v1alpha": { | ||
"AggregateBucketRequest": (timeseries_query, AggregateBucketRequest), | ||
"SpanSamplesRequest": (span_samples_query, SpanSamplesRequest), | ||
"TraceItemAttributesRequest": ( | ||
trace_item_attribute_list_query, | ||
TraceItemAttributesRequest, | ||
), | ||
"AttributeValuesRequest": ( | ||
trace_item_attribute_values_query, | ||
AttributeValuesRequest, | ||
), | ||
} | ||
} | ||
|
||
|
||
def get_rpc_endpoint( | ||
name: str, version: str | ||
) -> Tuple[Callable[[Any, Timer], ProtobufMessage], type[ProtobufMessage]]: | ||
return ALL_RPCS[version][name] |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +0,0 @@ | ||
from typing import Any, Callable, Mapping, Tuple | ||
|
||
from google.protobuf.message import Message as ProtobufMessage | ||
from sentry_protos.snuba.v1alpha.endpoint_aggregate_bucket_pb2 import ( | ||
AggregateBucketRequest, | ||
) | ||
from sentry_protos.snuba.v1alpha.endpoint_span_samples_pb2 import SpanSamplesRequest | ||
from sentry_protos.snuba.v1alpha.endpoint_tags_list_pb2 import ( | ||
AttributeValuesRequest, | ||
TraceItemAttributesRequest, | ||
) | ||
|
||
from snuba.utils.metrics.timer import Timer | ||
from snuba.web.rpc.span_samples import span_samples_query | ||
from snuba.web.rpc.timeseries import timeseries_query | ||
from snuba.web.rpc.trace_item_attribute_list import trace_item_attribute_list_query | ||
from snuba.web.rpc.trace_item_attribute_values import trace_item_attribute_values_query | ||
|
||
ALL_RPCS: Mapping[ | ||
str, Tuple[Callable[[Any, Timer], ProtobufMessage], type[ProtobufMessage]] | ||
] = { | ||
"AggregateBucketRequest": (timeseries_query, AggregateBucketRequest), | ||
"SpanSamplesRequest": (span_samples_query, SpanSamplesRequest), | ||
"TraceItemAttributesRequest": ( | ||
trace_item_attribute_list_query, | ||
TraceItemAttributesRequest, | ||
), | ||
"AttributeValuesRequest": ( | ||
trace_item_attribute_values_query, | ||
AttributeValuesRequest, | ||
), | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters