Skip to content

Commit

Permalink
[wip] remove generated jsonschema code
Browse files Browse the repository at this point in the history
This code will live in the opentelemetry-go-contrib repo in the future.

Signed-off-by: Alex Boten <aboten@lightstep.com>
  • Loading branch information
Alex Boten committed Oct 10, 2023
1 parent 5361583 commit c321970
Show file tree
Hide file tree
Showing 29 changed files with 2,625 additions and 1,329 deletions.
25 changes: 25 additions & 0 deletions .chloggen/codeboten_rm-generated-jsonschema-code.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: deprecation

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: telemetry

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: deprecate jsonschema generated types

# One or more tracking issues or pull requests related to the change
issues: [15009]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [api]
26 changes: 0 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -250,32 +250,6 @@ genpdata:
$(GOCMD) run pdata/internal/cmd/pdatagen/main.go
$(MAKE) fmt

# The source directory for configuration schema.
OPENTELEMETRY_JSONSCHEMA_SRC_DIR=service/internal/proctelemetry/opentelememetry-configuration

# The SHA matching the current version of the configuration schema to use
OPENTELEMETRY_JSONSCHEMA_VERSION=main

# Cleanup temporary directory
genjsonschema-cleanup:
rm -Rf ${OPENTELEMETRY_JSONSCHEMA_SRC_DIR}

# Generate structs for configuration from configuration schema
genjsonschema: genjsonschema-cleanup $(GOJSONSCHEMA)
mkdir -p ${OPENTELEMETRY_JSONSCHEMA_SRC_DIR}
curl -sSL https://api.github.com/repos/open-telemetry/opentelemetry-configuration/tarball/${OPENTELEMETRY_JSONSCHEMA_VERSION} | tar xz --strip 1 -C ${OPENTELEMETRY_JSONSCHEMA_SRC_DIR}
$(GOJSONSCHEMA) \
--package telemetry \
--tags mapstructure \
--output ./service/telemetry/generated_config.go \
--schema-package=https://opentelemetry.io/otelconfig/opentelemetry_configuration.json=github.com/open-telemetry/opentelemetry-collector/schema \
${OPENTELEMETRY_JSONSCHEMA_SRC_DIR}/schema/opentelemetry_configuration.json
@echo Modify jsonschema generated files.
sed -f $(TOOLS_MOD_DIR)/jsonschema_patch.sed service/telemetry/generated_config.go > service/telemetry/generated_config_tmp.go
mv service/telemetry/generated_config_tmp.go service/telemetry/generated_config.go
$(MAKE) fmt
$(MAKE) genjsonschema-cleanup

# Generate semantic convention constants. Requires a clone of the opentelemetry-specification repo
gensemconv:
@[ "${SPECPATH}" ] || ( echo ">> env var SPECPATH is not set"; exit 1 )
Expand Down
1 change: 1 addition & 0 deletions cmd/otelcorecol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ require (
go.opentelemetry.io/collector/pdata v1.0.0-rcv0015 // indirect
go.opentelemetry.io/collector/semconv v0.86.0 // indirect
go.opentelemetry.io/collector/service v0.86.0 // indirect
go.opentelemetry.io/contrib/config v0.0.0-20231010181927-c8c6d7571ef1 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.45.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
go.opentelemetry.io/contrib/propagators/b3 v1.19.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions cmd/otelcorecol/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,8 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/contrib/config v0.0.0-20231010181927-c8c6d7571ef1 h1:pMLXfZH56nffCKDTja2/kQE/fqP6fXpoIWZ9TlpFOiQ=
go.opentelemetry.io/contrib/config v0.0.0-20231010181927-c8c6d7571ef1/go.mod h1:qKXBHgegWLUm7O+tb8KQ+SWZ+08b5/6Pnze39ZVNagM=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.45.0 h1:RsQi0qJ2imFfCvZabqzM9cNXBG8k6gXMv1A0cXRmH6A=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.45.0/go.mod h1:vsh3ySueQCiKPxFLvjWC4Z135gIa34TQ/NSqkDTZYUM=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 h1:x8Z78aZx8cOF0+Kkazoc7lwUNMGy0LrzEMxTm4BbTxg=
Expand Down
7 changes: 4 additions & 3 deletions exporter/otlpexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ require (
)

require (
cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
Expand Down Expand Up @@ -49,11 +48,10 @@ require (
go.opentelemetry.io/collector/extension v0.86.0 // indirect
go.opentelemetry.io/collector/extension/auth v0.86.0 // indirect
go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015 // indirect
go.opentelemetry.io/collector/service v0.86.0 // indirect
go.opentelemetry.io/contrib/config v0.0.0-20231010181927-c8c6d7571ef1 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.45.0 // indirect
go.opentelemetry.io/otel v1.19.0 // indirect
go.opentelemetry.io/otel/metric v1.19.0 // indirect
go.opentelemetry.io/otel/sdk v1.19.0 // indirect
go.opentelemetry.io/otel/trace v1.19.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
Expand Down Expand Up @@ -113,3 +111,6 @@ retract (
replace go.opentelemetry.io/collector/connector => ../../connector

replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry

// ambiguous import: found package cloud.google.com/go/compute/metadata in multiple modules
replace cloud.google.com/go => cloud.google.com/go v0.110.2

0 comments on commit c321970

Please sign in to comment.