Skip to content

Commit

Permalink
fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sbiscigl committed Jul 14, 2023
1 parent 0fef1e9 commit 3737d1d
Show file tree
Hide file tree
Showing 7 changed files with 422 additions and 71 deletions.
4 changes: 2 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"mqtt",
// Aws common runtime API
"Mtls",
// Opentelemtry
"Otel", "opentelemetry", "nostd", "OPTEL"
// Opentelemetry
"Otel", "opentelemetry", "nostd", "OPTEL", "tparam"
],
"ignoreWords": [
// variables defined in ConcurrentStreamBuf
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,18 @@ void TranscribeStreamingServiceClient::StartCallAnalyticsStreamTranscriptionAsyn
handler(this, request, StartCallAnalyticsStreamTranscriptionOutcome(Aws::Client::AWSError<TranscribeStreamingServiceErrors>(TranscribeStreamingServiceErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [MediaEncoding]", false)), handlerContext);
return;
}
auto endpointResolutionOutcome = TracingUtils::MakeCallWithTiming<ResolveEndpointOutcome>(
[&]() -> ResolveEndpointOutcome { return m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams()); },
TracingUtils::SMITHY_CLIENT_ENDPOINT_RESOLUTION_METRIC,
*meter,
{{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}});
if (!endpointResolutionOutcome.IsSuccess()) {
handler(this, request, StartCallAnalyticsStreamTranscriptionOutcome(Aws::Client::AWSError<CoreErrors>(
CoreErrors::ENDPOINT_RESOLUTION_FAILURE, "ENDPOINT_RESOLUTION_FAILURE", endpointResolutionOutcome.GetError().GetMessage(), false)), handlerContext);
return;
}
endpointResolutionOutcome.GetResult().AddPathSegments("/call-analytics-stream-transcription");
auto meter = m_telemetryProvider->getMeter(this->GetServiceClientName(), {});
auto endpointResolutionOutcome = TracingUtils::MakeCallWithTiming<ResolveEndpointOutcome>(
[&]() -> ResolveEndpointOutcome { return m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams()); },
TracingUtils::SMITHY_CLIENT_ENDPOINT_RESOLUTION_METRIC,
*meter,
{{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}});
if (!endpointResolutionOutcome.IsSuccess()) {
handler(this, request, StartCallAnalyticsStreamTranscriptionOutcome(Aws::Client::AWSError<CoreErrors>(
CoreErrors::ENDPOINT_RESOLUTION_FAILURE, "ENDPOINT_RESOLUTION_FAILURE", endpointResolutionOutcome.GetError().GetMessage(), false)), handlerContext);
return;
}
endpointResolutionOutcome.GetResult().AddPathSegments("/call-analytics-stream-transcription");
request.SetResponseStreamFactory(
[&] { request.GetEventStreamDecoder().Reset(); return Aws::New<Aws::Utils::Event::EventDecoderStream>(ALLOCATION_TAG, request.GetEventStreamDecoder()); }
);
Expand Down Expand Up @@ -261,17 +262,18 @@ void TranscribeStreamingServiceClient::StartMedicalStreamTranscriptionAsync(Mode
handler(this, request, StartMedicalStreamTranscriptionOutcome(Aws::Client::AWSError<TranscribeStreamingServiceErrors>(TranscribeStreamingServiceErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [Type]", false)), handlerContext);
return;
}
auto endpointResolutionOutcome = TracingUtils::MakeCallWithTiming<ResolveEndpointOutcome>(
[&]() -> ResolveEndpointOutcome { return m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams()); },
TracingUtils::SMITHY_CLIENT_ENDPOINT_RESOLUTION_METRIC,
*meter,
{{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}});
if (!endpointResolutionOutcome.IsSuccess()) {
handler(this, request, StartMedicalStreamTranscriptionOutcome(Aws::Client::AWSError<CoreErrors>(
CoreErrors::ENDPOINT_RESOLUTION_FAILURE, "ENDPOINT_RESOLUTION_FAILURE", endpointResolutionOutcome.GetError().GetMessage(), false)), handlerContext);
return;
}
endpointResolutionOutcome.GetResult().AddPathSegments("/medical-stream-transcription");
auto meter = m_telemetryProvider->getMeter(this->GetServiceClientName(), {});
auto endpointResolutionOutcome = TracingUtils::MakeCallWithTiming<ResolveEndpointOutcome>(
[&]() -> ResolveEndpointOutcome { return m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams()); },
TracingUtils::SMITHY_CLIENT_ENDPOINT_RESOLUTION_METRIC,
*meter,
{{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}});
if (!endpointResolutionOutcome.IsSuccess()) {
handler(this, request, StartMedicalStreamTranscriptionOutcome(Aws::Client::AWSError<CoreErrors>(
CoreErrors::ENDPOINT_RESOLUTION_FAILURE, "ENDPOINT_RESOLUTION_FAILURE", endpointResolutionOutcome.GetError().GetMessage(), false)), handlerContext);
return;
}
endpointResolutionOutcome.GetResult().AddPathSegments("/medical-stream-transcription");
request.SetResponseStreamFactory(
[&] { request.GetEventStreamDecoder().Reset(); return Aws::New<Aws::Utils::Event::EventDecoderStream>(ALLOCATION_TAG, request.GetEventStreamDecoder()); }
);
Expand Down Expand Up @@ -319,17 +321,18 @@ void TranscribeStreamingServiceClient::StartStreamTranscriptionAsync(Model::Star
handler(this, request, StartStreamTranscriptionOutcome(Aws::Client::AWSError<TranscribeStreamingServiceErrors>(TranscribeStreamingServiceErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [MediaEncoding]", false)), handlerContext);
return;
}
auto endpointResolutionOutcome = TracingUtils::MakeCallWithTiming<ResolveEndpointOutcome>(
[&]() -> ResolveEndpointOutcome { return m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams()); },
TracingUtils::SMITHY_CLIENT_ENDPOINT_RESOLUTION_METRIC,
*meter,
{{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}});
if (!endpointResolutionOutcome.IsSuccess()) {
handler(this, request, StartStreamTranscriptionOutcome(Aws::Client::AWSError<CoreErrors>(
CoreErrors::ENDPOINT_RESOLUTION_FAILURE, "ENDPOINT_RESOLUTION_FAILURE", endpointResolutionOutcome.GetError().GetMessage(), false)), handlerContext);
return;
}
endpointResolutionOutcome.GetResult().AddPathSegments("/stream-transcription");
auto meter = m_telemetryProvider->getMeter(this->GetServiceClientName(), {});
auto endpointResolutionOutcome = TracingUtils::MakeCallWithTiming<ResolveEndpointOutcome>(
[&]() -> ResolveEndpointOutcome { return m_endpointProvider->ResolveEndpoint(request.GetEndpointContextParams()); },
TracingUtils::SMITHY_CLIENT_ENDPOINT_RESOLUTION_METRIC,
*meter,
{{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}});
if (!endpointResolutionOutcome.IsSuccess()) {
handler(this, request, StartStreamTranscriptionOutcome(Aws::Client::AWSError<CoreErrors>(
CoreErrors::ENDPOINT_RESOLUTION_FAILURE, "ENDPOINT_RESOLUTION_FAILURE", endpointResolutionOutcome.GetError().GetMessage(), false)), handlerContext);
return;
}
endpointResolutionOutcome.GetResult().AddPathSegments("/stream-transcription");
request.SetResponseStreamFactory(
[&] { request.GetEventStreamDecoder().Reset(); return Aws::New<Aws::Utils::Event::EventDecoderStream>(ALLOCATION_TAG, request.GetEventStreamDecoder()); }
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ namespace smithy {
namespace components {
namespace tracing {
/**
* A no-op implementation of TelemtryProvider that
* is simply pass though container of telemtry funtionality
* A no-op implementation of TelemetryProvider that
* is simply pass though container of telemetry functionality
*/
class SMITHY_API NoopTelemetryProvider {
public:
Expand Down
4 changes: 2 additions & 2 deletions src/aws-cpp-sdk-core/include/smithy/tracing/TracingUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace smithy {
static const char SMITHY_METRICS_UNKNOWN_METRIC[];

/**
* Will run a function and emit the duration of that function in milisecond timing to the
* Will run a function and emit the duration of that function in millisecond timing to the
* meter provided as a Histogram metrics. Will return the result af the function.
* @tparam T The type that is being returned from the function.
* @param func A function that returns T.
Expand Down Expand Up @@ -75,7 +75,7 @@ namespace smithy {
}

/**
* Will run a function and emit the duration of that function in milisecond timing to the
* Will run a function and emit the duration of that function in millisecond timing to the
* meter provided as a Histogram metrics.
* @param func a function that does not return anything but will be measured.
* @param metricName The name of the metric that is being captured by the function.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#if($serviceModel.endpointRules)
#if($serviceNamespace == "S3Crt" && $operation.s3CrtEnabled)
#if(($serviceNamespace == "S3Crt" && $operation.s3CrtEnabled) || $serviceNamespace == "TranscribeStreamingService")
#set($meterNeeded = true)
#set($indent = "")
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,31 @@ ${operation.name}Outcome ${className}::${operation.name}(const ${operation.reque
{
AWS_OPERATION_GUARD(${operation.name});
#parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/common/ServiceClientOperationRequestRequiredMemberValidate.vm")
auto tracer = m_telemetryProvider->getTracer(this->GetServiceClientName(), {});
auto meter = m_telemetryProvider->getMeter(this->GetServiceClientName(), {});
AWS_OPERATION_CHECK_PTR(meter, ${operation.name}, CoreErrors, CoreErrors::NOT_INITIALIZED);
auto span = tracer->CreateSpan(Aws::String(this->GetServiceClientName()) + "." + request.GetServiceRequestName(),
{{ TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName() }, { TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName() }, { TracingUtils::SMITHY_SYSTEM_DIMENSION, TracingUtils::SMITHY_METHOD_AWS_VALUE }},
smithy::components::tracing::SpanKind::CLIENT);
return TracingUtils::MakeCallWithTiming<${operation.name}Outcome>(
[&]() -> ${operation.name}Outcome{
#if($serviceModel.endpointRules)
#parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/common/ServiceClientOperationEndpointPrepareCommonBody.vm")
#parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/common/UriRequestQueryParams.vm")
return ${operation.name}Outcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_${operation.http.method}));
return ${operation.name}Outcome(MakeRequest(request, endpointResolutionOutcome.GetResult(), Aws::Http::HttpMethod::HTTP_${operation.http.method}));
#else##-#if($serviceModel.endpointRules)
#if($operation.name != "Predict")
#parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/common/ServiceClientOperationEndpointPrepareCommonBody.vm")
#parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/common/UriRequestQueryParams.vm")
return ${operation.name}Outcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_${operation.http.method}));
return ${operation.name}Outcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_${operation.http.method}));
#else
return ${operation.name}Outcome(MakeRequest(request.GetPredictEndpoint(), request, Aws::Http::HttpMethod::HTTP_${operation.http.method}));
return ${operation.name}Outcome(MakeRequest(request.GetPredictEndpoint(), request, Aws::Http::HttpMethod::HTTP_${operation.http.method}));
#end
#end##-#if($serviceModel.endpointRules)
},
TracingUtils::SMITHY_CLIENT_DURATION_METRIC,
*meter,
{{TracingUtils::SMITHY_METHOD_DIMENSION, request.GetServiceRequestName()}, {TracingUtils::SMITHY_SERVICE_DIMENSION, this->GetServiceClientName()}});
}

#parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/common/operation/withrequest/OperationOutcomeCallable.vm")
Expand Down

0 comments on commit 3737d1d

Please sign in to comment.