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

Don't produce histograms in /telemetry JSON response #3708

Merged
merged 1 commit into from
Feb 27, 2024
Merged

Conversation

xzfc
Copy link
Contributor

@xzfc xzfc commented Feb 27, 2024

Issue

An OpenAPI generator chokes on schema changes introduced in #3552, in particular, on heterogeneous arrays in the duration_micros_histogram field.

The error message is:

$ docker run --user 1000:100 --rm -v /run/user/1000/tmp.nu7jls5JNY/pydantic_openapi_v3/scripts/output:/generator-output -v /run/user/1000/tmp.nu7jls5JNY/pydantic_openapi_v3/openapi-qdrant.yaml:/local/openapi.yaml openapitools/openapi-generator-cli:v5.1.1 generate -g python --global-property debugModels=true -o /generator-output -i /local/openapi.yaml
Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
 | Error count: 2, Warning count: 0
Errors: 
	-attribute components.schemas.OperationDurationStatistics.items is not of type `object`
	-attribute components.schemas.OperationDurationStatistics.items is missing

	at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:546)
	at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:573)
	at org.openapitools.codegen.cmd.Generate.execute(Generate.java:433)
	at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)

Solution (this PR)

Drop these statistics from the JSON /telemetry output, regardless from the details level. Keep it in the Prometheus /metrics.

@xzfc xzfc merged commit 78cc433 into dev Feb 27, 2024
17 checks passed
@xzfc xzfc deleted the drop-stats-buckets branch February 27, 2024 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants