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 0521c7b
Show file tree
Hide file tree
Showing 10 changed files with 779 additions and 115 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
Original file line number Diff line number Diff line change
Expand Up @@ -471,25 +471,26 @@ void LexRuntimeV2Client::StartConversationAsync(Model::StartConversationRequest&
handler(this, request, StartConversationOutcome(Aws::Client::AWSError<LexRuntimeV2Errors>(LexRuntimeV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [SessionId]", 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, StartConversationOutcome(Aws::Client::AWSError<CoreErrors>(
CoreErrors::ENDPOINT_RESOLUTION_FAILURE, "ENDPOINT_RESOLUTION_FAILURE", endpointResolutionOutcome.GetError().GetMessage(), false)), handlerContext);
return;
}
endpointResolutionOutcome.GetResult().AddPathSegments("/bots/");
endpointResolutionOutcome.GetResult().AddPathSegment(request.GetBotId());
endpointResolutionOutcome.GetResult().AddPathSegments("/botAliases/");
endpointResolutionOutcome.GetResult().AddPathSegment(request.GetBotAliasId());
endpointResolutionOutcome.GetResult().AddPathSegments("/botLocales/");
endpointResolutionOutcome.GetResult().AddPathSegment(request.GetLocaleId());
endpointResolutionOutcome.GetResult().AddPathSegments("/sessions/");
endpointResolutionOutcome.GetResult().AddPathSegment(request.GetSessionId());
endpointResolutionOutcome.GetResult().AddPathSegments("/conversation");
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, StartConversationOutcome(Aws::Client::AWSError<CoreErrors>(
CoreErrors::ENDPOINT_RESOLUTION_FAILURE, "ENDPOINT_RESOLUTION_FAILURE", endpointResolutionOutcome.GetError().GetMessage(), false)), handlerContext);
return;
}
endpointResolutionOutcome.GetResult().AddPathSegments("/bots/");
endpointResolutionOutcome.GetResult().AddPathSegment(request.GetBotId());
endpointResolutionOutcome.GetResult().AddPathSegments("/botAliases/");
endpointResolutionOutcome.GetResult().AddPathSegment(request.GetBotAliasId());
endpointResolutionOutcome.GetResult().AddPathSegments("/botLocales/");
endpointResolutionOutcome.GetResult().AddPathSegment(request.GetLocaleId());
endpointResolutionOutcome.GetResult().AddPathSegments("/sessions/");
endpointResolutionOutcome.GetResult().AddPathSegment(request.GetSessionId());
endpointResolutionOutcome.GetResult().AddPathSegments("/conversation");
request.SetResponseStreamFactory(
[&] { request.GetEventStreamDecoder().Reset(); return Aws::New<Aws::Utils::Event::EventDecoderStream>(ALLOCATION_TAG, request.GetEventStreamDecoder()); }
);
Expand Down

Large diffs are not rendered by default.

345 changes: 322 additions & 23 deletions generated/src/aws-cpp-sdk-sqs/source/SQSClient.cpp

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" || ($serviceNamespace == "LexRuntimeV2" && $operation.name == "StartConversation"))
#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
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,29 @@ ${operation.name}Outcome ${className}::${operation.name}(const ${operation.reque
{
AWS_OPERATION_GUARD(${operation.name});
#parse("com/amazonaws/util/awsclientgenerator/velocity/cpp/common/ServiceClientOperationRequestRequiredMemberValidate.vm")
AWS_OPERATION_CHECK_PTR(m_telemetryProvider, CancelMessageMoveTask, CoreErrors, CoreErrors::NOT_INITIALIZED);
auto tracer = m_telemetryProvider->getTracer(this->GetServiceClientName(), {});
auto meter = m_telemetryProvider->getMeter(this->GetServiceClientName(), {});
AWS_OPERATION_CHECK_PTR(meter, CancelMessageMoveTask, 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 {
#set($operationsUseQueueUrlEndpoint = ['AddPermission' , 'RemovePermission' , 'ChangeMessageVisibility', 'DeleteQueue', 'DeleteMessage', 'GetQueueAttributes',
'ReceiveMessage', 'SetQueueAttributes', 'SendMessage', 'SendMessageBatch', 'ChangeMessageVisibilityBatch',
'DeleteMessageBatch', 'ListDeadLetterSourceQueues', 'PurgeQueue', 'TagQueue', 'UntagQueue', 'ListQueueTags'])
#if($operationsUseQueueUrlEndpoint.contains($operation.name))
return ${operation.name}Outcome(MakeRequest(request.GetQueueUrl(), request, Aws::Http::HttpMethod::HTTP_${operation.http.method}));
return ${operation.name}Outcome(MakeRequest(request.GetQueueUrl(), request, Aws::Http::HttpMethod::HTTP_${operation.http.method}));
#else
#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}));
#end
},
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 0521c7b

Please sign in to comment.