From 1b41510bb55182534c813325090a4cfba618bc00 Mon Sep 17 00:00:00 2001 From: Jade Guiton Date: Wed, 27 Nov 2024 13:52:00 +0100 Subject: [PATCH 1/6] [chore] Add `merge_group` trigger to required workflows (#11764) #### Description In preparation for the merge queue potentially being enabled,, this PR adds the `merge_group` trigger to CI workflows that run in `main` pull requests. #### Link to tracking issue Updates #11707 --- .github/workflows/api-compatibility.yml | 2 ++ .github/workflows/build-and-test-arm.yml | 1 + .github/workflows/build-and-test-windows.yaml | 2 ++ .github/workflows/build-and-test.yml | 2 ++ .github/workflows/builder-integration-test.yaml | 3 +++ .github/workflows/changelog.yml | 2 ++ .github/workflows/check-links.yaml | 2 ++ .github/workflows/contrib-tests.yml | 2 ++ .github/workflows/shellcheck.yml | 2 ++ 9 files changed, 18 insertions(+) diff --git a/.github/workflows/api-compatibility.yml b/.github/workflows/api-compatibility.yml index 362606d42e2..987d7a2e5fe 100644 --- a/.github/workflows/api-compatibility.yml +++ b/.github/workflows/api-compatibility.yml @@ -9,6 +9,8 @@ on: pull_request: branches: - main + merge_group: + types: [checks_requested] permissions: contents: read diff --git a/.github/workflows/build-and-test-arm.yml b/.github/workflows/build-and-test-arm.yml index 84e09e2b3f0..43d3fdd67fb 100644 --- a/.github/workflows/build-and-test-arm.yml +++ b/.github/workflows/build-and-test-arm.yml @@ -5,6 +5,7 @@ on: tags: - "v[0-9]+.[0-9]+.[0-9]+*" merge_group: + types: [checks_requested] pull_request: env: TEST_RESULTS: testbed/tests/results/junit/results.xml diff --git a/.github/workflows/build-and-test-windows.yaml b/.github/workflows/build-and-test-windows.yaml index a67d6b8426b..7c1c2cae486 100644 --- a/.github/workflows/build-and-test-windows.yaml +++ b/.github/workflows/build-and-test-windows.yaml @@ -4,6 +4,8 @@ on: branches: [main] tags: - "v[0-9]+.[0-9]+.[0-9]+*" + merge_group: + types: [checks_requested] pull_request: concurrency: diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 84a7f6c8d19..87bca602738 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -4,6 +4,8 @@ on: branches: [main] tags: - "v[0-9]+.[0-9]+.[0-9]+*" + merge_group: + types: [checks_requested] pull_request: permissions: diff --git a/.github/workflows/builder-integration-test.yaml b/.github/workflows/builder-integration-test.yaml index 1f798c7485b..3824743aba1 100644 --- a/.github/workflows/builder-integration-test.yaml +++ b/.github/workflows/builder-integration-test.yaml @@ -15,6 +15,9 @@ on: # manual execution workflow_dispatch: + + merge_group: + types: [checks_requested] concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 621146c1136..4f3538f08bd 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -9,6 +9,8 @@ on: types: [opened, ready_for_review, synchronize, reopened, labeled, unlabeled] branches: - main + merge_group: + types: [checks_requested] concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} diff --git a/.github/workflows/check-links.yaml b/.github/workflows/check-links.yaml index e28a92d32f4..fb95982d818 100644 --- a/.github/workflows/check-links.yaml +++ b/.github/workflows/check-links.yaml @@ -3,6 +3,8 @@ on: push: branches: [main] pull_request: + merge_group: + types: [checks_requested] concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} diff --git a/.github/workflows/contrib-tests.yml b/.github/workflows/contrib-tests.yml index 9671901c763..90e8067df1e 100644 --- a/.github/workflows/contrib-tests.yml +++ b/.github/workflows/contrib-tests.yml @@ -7,6 +7,8 @@ on: pull_request: types: [opened, ready_for_review, synchronize, reopened, labeled, unlabeled] branches: [main] + merge_group: + types: [checks_requested] concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 735e694b528..99ad4d48737 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -4,6 +4,8 @@ on: branches: [ main ] pull_request: branches: [ main ] + merge_group: + types: [checks_requested] permissions: contents: read From 79357e8c601152863fb30e9a27f2bf1e4668e44e Mon Sep 17 00:00:00 2001 From: Daniel Jaglowski Date: Wed, 27 Nov 2024 07:58:45 -0500 Subject: [PATCH 2/6] RFC - Pipeline Component Telemetry (#11406) This PR adds a RFC for normalized telemetry across all pipeline components. See https://github.com/open-telemetry/opentelemetry-collector/issues/11343 edit by @mx-psi: - Announced on #otel-collector-dev on 2024-10-23: https://cloud-native.slack.com/archives/C07CCCMRXBK/p1729705290741179 - Announced on the Collector SIG meeting from 2024-10-30 --------- Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com> Co-authored-by: Damien Mathieu <42@dmathieu.com> Co-authored-by: William Dumont Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com> --- docs/rfcs/component-universal-telemetry.md | 218 +++++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 docs/rfcs/component-universal-telemetry.md diff --git a/docs/rfcs/component-universal-telemetry.md b/docs/rfcs/component-universal-telemetry.md new file mode 100644 index 00000000000..4a721fbad1b --- /dev/null +++ b/docs/rfcs/component-universal-telemetry.md @@ -0,0 +1,218 @@ +# Pipeline Component Telemetry + +## Motivation and Scope + +The collector should be observable and this must naturally include observability of its pipeline components. Pipeline components +are those components of the collector which directly interact with data, specifically receivers, processors, exporters, and connectors. + +It is understood that each _type_ (`filelog`, `batch`, etc) of component may emit telemetry describing its internal workings, +and that these internally derived signals may vary greatly based on the concerns and maturity of each component. Naturally +though, there is much we can do to normalize the telemetry emitted from and about pipeline components. + +Two major challenges in pursuit of broadly normalized telemetry are (1) consistent attributes, and (2) automatic capture. + +This RFC represents an evolving consensus about the desired end state of component telemetry. It does _not_ claim +to describe the final state of all component telemetry, but rather seeks to document some specific aspects. It proposes a set of +attributes which are both necessary and sufficient to identify components and their instances. It also articulates one specific +mechanism by which some telemetry can be automatically captured. Finally, it describes some specific metrics and logs which should +be automatically captured for each kind of pipeline component. + +## Goals + +1. Define attributes that are (A) specific enough to describe individual component[_instances_](https://github.com/open-telemetry/opentelemetry-collector/issues/10534) + and (B) consistent enough for correlation across signals. +2. Articulate a mechanism which enables us to _automatically_ capture telemetry from _all pipeline components_. +3. Define specific metrics for each kind of pipeline component. +4. Define specific logs for all kinds of pipeline component. + +## Attributes + +All signals should use the following attributes: + +### Receivers + +- `otelcol.component.kind`: `receiver` +- `otelcol.component.id`: The component ID +- `otelcol.signal`: `logs`, `metrics`, `traces`, `profiles` + +### Processors + +- `otelcol.component.kind`: `processor` +- `otelcol.component.id`: The component ID +- `otelcol.pipeline.id`: The pipeline ID +- `otelcol.signal`: `logs`, `metrics`, `traces`, `profiles` + +### Exporters + +- `otelcol.component.kind`: `exporter` +- `otelcol.component.id`: The component ID +- `otelcol.signal`: `logs`, `metrics` `traces`, `profiles` + +### Connectors + +- `otelcol.component.kind`: `connector` +- `otelcol.component.id`: The component ID +- `otelcol.signal`: `logs`, `metrics` `traces` +- `otelcol.signal.output`: `logs`, `metrics` `traces`, `profiles` + +Note: The `otelcol.signal`, `otelcol.signal.output`, or `otelcol.pipeline.id` attributes may be omitted if the corresponding component instances +are unified by the component implementation. For example, the `otlp` receiver is a singleton, so its telemetry is not specific to a signal. +Similarly, the `memory_limiter` processor is a singleton, so its telemetry is not specific to a pipeline. + +## Auto-Instrumentation Mechanism + +The mechanism of telemetry capture should be _external_ to components. Specifically, we should observe telemetry at each point where a +component passes data to another component, and, at each point where a component consumes data from another component. In terms of the +component graph, every _edge_ in the graph will have two layers of instrumentation - one for the producing component and one for the +consuming component. Importantly, each layer generates telemetry ascribed to a single component instance, so by having two layers per +edge we can describe both sides of each handoff independently. + +Telemetry captured by this mechanism should be associated with an instrumentation scope corresponding to the package which implements +the mechanism. Currently, that package is `service/internal/graph`, but this may change in the future. Notably, this telemetry is not +ascribed to individual component packages, both because the instrumentation scope is intended to describe the origin of the telemetry, +and because no mechanism is presently identified which would allow us to determine the characteristics of a component-specific scope. + +### Instrumentation Scope + +All telemetry described in this RFC should include a scope name which corresponds to the package which implements the telemetry. If the +package is internal, then the scope name should be that of the module which contains the package. For example, +`go.opentelemetry.io/service` should be used instead of `go.opentelemetry.io/service/internal/graph`. + +### Auto-Instrumented Metrics + +There are two straightforward measurements that can be made on any pdata: + +1. A count of "items" (spans, data points, or log records). These are low cost but broadly useful, so they should be enabled by default. +2. A measure of size, based on [ProtoMarshaler.Sizer()](https://github.com/open-telemetry/opentelemetry-collector/blob/9907ba50df0d5853c34d2962cf21da42e15a560d/pdata/ptrace/pb.go#l11). + These may be high cost to compute, so by default they should be disabled (and not calculated). This default setting may change in the future if it is demonstrated that the cost is generally acceptable. + +The location of these measurements can be described in terms of whether the data is "consumed" or "produced", from the perspective of the +component to which the telemetry is attributed. Metrics which contain the term "produced" describe data which is emitted from the component, +while metrics which contain the term "consumed" describe data which is received by the component. + +For both metrics, an `outcome` attribute with possible values `success` and `failure` should be automatically recorded, corresponding to +whether or not the corresponding function call returned an error. Specifically, consumed measurements will be recorded with `outcome` as +`failure` when a call from the previous component the `ConsumeX` function returns an error, and `success` otherwise. Likewise, produced +measurements will be recorded with `outcome` as `failure` when a call to the next consumer's `ConsumeX` function returns an error, and +`success` otherwise. + +```yaml + otelcol.receiver.produced.items: + enabled: true + description: Number of items emitted from the receiver. + unit: "{item}" + sum: + value_type: int + monotonic: true + otelcol.processor.consumed.items: + enabled: true + description: Number of items passed to the processor. + unit: "{item}" + sum: + value_type: int + monotonic: true + otelcol.processor.produced.items: + enabled: true + description: Number of items emitted from the processor. + unit: "{item}" + sum: + value_type: int + monotonic: true + otelcol.connector.consumed.items: + enabled: true + description: Number of items passed to the connector. + unit: "{item}" + sum: + value_type: int + monotonic: true + otelcol.connector.produced.items: + enabled: true + description: Number of items emitted from the connector. + unit: "{item}" + sum: + value_type: int + monotonic: true + otelcol.exporter.consumed.items: + enabled: true + description: Number of items passed to the exporter. + unit: "{item}" + sum: + value_type: int + monotonic: true + + otelcol.receiver.produced.size: + enabled: false + description: Size of items emitted from the receiver. + unit: "By" + sum: + value_type: int + monotonic: true + otelcol.processor.consumed.size: + enabled: false + description: Size of items passed to the processor. + unit: "By" + sum: + value_type: int + monotonic: true + otelcol.processor.produced.size: + enabled: false + description: Size of items emitted from the processor. + unit: "By" + sum: + value_type: int + monotonic: true + otelcol.connector.consumed.size: + enabled: false + description: Size of items passed to the connector. + unit: "By" + sum: + value_type: int + monotonic: true + otelcol.connector.produced.size: + enabled: false + description: Size of items emitted from the connector. + unit: "By" + sum: + value_type: int + monotonic: true + otelcol.exporter.consumed.size: + enabled: false + description: Size of items passed to the exporter. + unit: "By" + sum: + value_type: int + monotonic: true +``` + +### Auto-Instrumented Logs + +Metrics provide most of the observability we need but there are some gaps which logs can fill. Although metrics would describe the overall +item counts, it is helpful in some cases to record more granular events. e.g. If a produced batch of 10,000 spans results in an error, but +100 batches of 100 spans succeed, this may be a matter of batch size that can be detected by analyzing logs, while the corresponding metric +reports only that a 50% success rate is observed. + +For security and performance reasons, it would not be appropriate to log the contents of telemetry. + +It's very easy for logs to become too noisy. Even if errors are occurring frequently in the data pipeline, only the errors that are not +handled automatically will be of interest to most users. + +With the above considerations, this proposal includes only that we add a DEBUG log for each individual outcome. This should be sufficient for +detailed troubleshooting but does not impact users otherwise. + +In the future, it may be helpful to define triggers for reporting repeated failures at a higher severity level. e.g. N number of failures in +a row, or a moving average success %. For now, the criteria and necessary configurability is unclear so this is mentioned only as an example +of future possibilities. + +### Auto-Instrumented Spans + +It is not clear that any spans can be captured automatically with the proposed mechanism. We have the ability to insert instrumentation both +before and after processors and connectors. However, we generally cannot assume a 1:1 relationship between consumed and produced data. + +## Additional Context + +This proposal pulls from a number of issues and PRs: + +- [Demonstrate graph-based metrics](https://github.com/open-telemetry/opentelemetry-collector/pull/11311) +- [Attributes for component instancing](https://github.com/open-telemetry/opentelemetry-collector/issues/11179) +- [Simple processor metrics](https://github.com/open-telemetry/opentelemetry-collector/issues/10708) +- [Component instancing is complicated](https://github.com/open-telemetry/opentelemetry-collector/issues/10534) From f25fd8d0068350cd5f3323ca451c9722ab2f48c4 Mon Sep 17 00:00:00 2001 From: Jeremy Corley <55004047+ms-jcorley@users.noreply.github.com> Date: Wed, 27 Nov 2024 11:06:33 -0800 Subject: [PATCH 3/6] system/telemetry metrics OTLP GRPC Exporter: add CA certificate support (#11633) #### Description Adds support for CA certificates to the OTLP gRPC exporter for metrics in system/telemetry. Currently if a "Certificate" is specified in the config, it is silently ignored. #### Testing Both a positive and negative unit test was added. The good test CA certificate was copied from another unit test. I'm going to file an issue for updating all test certificates as all the ones I checked seem to expire in 2032 which is only 8 years away. #### Documentation None. --- .../service_telemetry_metrics_ca_cert.yaml | 25 +++++++++++ service/go.mod | 2 +- service/telemetry/internal/otelinit/config.go | 7 ++++ .../internal/otelinit/config_test.go | 42 +++++++++++++++++++ .../internal/otelinit/testdata/bad_cert.crt | 1 + .../internal/otelinit/testdata/ca.crt | 20 +++++++++ 6 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 .chloggen/service_telemetry_metrics_ca_cert.yaml create mode 100644 service/telemetry/internal/otelinit/testdata/bad_cert.crt create mode 100644 service/telemetry/internal/otelinit/testdata/ca.crt diff --git a/.chloggen/service_telemetry_metrics_ca_cert.yaml b/.chloggen/service_telemetry_metrics_ca_cert.yaml new file mode 100644 index 00000000000..d99b32e5f11 --- /dev/null +++ b/.chloggen/service_telemetry_metrics_ca_cert.yaml @@ -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: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: service + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add support for ca certificates in telemetry metrics otlp grpc exporter + +# One or more tracking issues or pull requests related to the change +issues: [11633] + +# (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: Before this change the Certificate value in config was silently ignored. + +# 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: [] diff --git a/service/go.mod b/service/go.mod index 9bceba4443f..d8944198742 100644 --- a/service/go.mod +++ b/service/go.mod @@ -60,6 +60,7 @@ require ( go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 gonum.org/v1/gonum v0.15.1 + google.golang.org/grpc v1.67.1 ) require ( @@ -120,7 +121,6 @@ require ( golang.org/x/text v0.20.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect - google.golang.org/grpc v1.67.1 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/service/telemetry/internal/otelinit/config.go b/service/telemetry/internal/otelinit/config.go index 402090675ac..bb75023f204 100644 --- a/service/telemetry/internal/otelinit/config.go +++ b/service/telemetry/internal/otelinit/config.go @@ -29,6 +29,7 @@ import ( sdkmetric "go.opentelemetry.io/otel/sdk/metric" "go.opentelemetry.io/otel/sdk/metric/metricdata" "go.opentelemetry.io/otel/sdk/resource" + "google.golang.org/grpc/credentials" semconv "go.opentelemetry.io/collector/semconv/v1.18.0" ) @@ -224,6 +225,12 @@ func initOTLPgRPCExporter(ctx context.Context, otlpConfig *config.OTLPMetric) (s opts = append(opts, otlpmetricgrpc.WithEndpoint(u.Host)) if u.Scheme == "http" { opts = append(opts, otlpmetricgrpc.WithInsecure()) + } else if otlpConfig.Certificate != nil { + creds, err := credentials.NewClientTLSFromFile(*otlpConfig.Certificate, "") + if err != nil { + return nil, fmt.Errorf("could not create client tls credentials: %w", err) + } + opts = append(opts, otlpmetricgrpc.WithTLSCredentials(creds)) } } diff --git a/service/telemetry/internal/otelinit/config_test.go b/service/telemetry/internal/otelinit/config_test.go index 02974fa11e4..5041a9d322c 100644 --- a/service/telemetry/internal/otelinit/config_test.go +++ b/service/telemetry/internal/otelinit/config_test.go @@ -6,7 +6,9 @@ package otelinit import ( "context" "errors" + "fmt" "net/url" + "path/filepath" "reflect" "sync" "testing" @@ -527,6 +529,46 @@ func TestMetricReader(t *testing.T) { }, wantErr: errors.New("unsupported temporality preference \"invalid\""), }, + { + name: "periodic/otlp-grpc-good-ca-certificate", + reader: config.MetricReader{ + Periodic: &config.PeriodicMetricReader{ + Exporter: config.MetricExporter{ + OTLP: &config.OTLPMetric{ + Protocol: "grpc/protobuf", + Endpoint: "https://localhost:4317", + Compression: strPtr("gzip"), + Timeout: intPtr(1000), + Certificate: strPtr(filepath.Join("testdata", "ca.crt")), + Headers: map[string]string{ + "test": "test1", + }, + }, + }, + }, + }, + wantReader: sdkmetric.NewPeriodicReader(otlpGRPCExporter), + }, + { + name: "periodic/otlp-grpc-bad-ca-certificate", + reader: config.MetricReader{ + Periodic: &config.PeriodicMetricReader{ + Exporter: config.MetricExporter{ + OTLP: &config.OTLPMetric{ + Protocol: "grpc/protobuf", + Endpoint: "https://localhost:4317", + Compression: strPtr("gzip"), + Timeout: intPtr(1000), + Certificate: strPtr(filepath.Join("testdata", "bad_cert.crt")), + Headers: map[string]string{ + "test": "test1", + }, + }, + }, + }, + }, + wantErr: fmt.Errorf("could not create client tls credentials: %w", errors.New("credentials: failed to append certificates")), + }, } for _, tt := range testCases { t.Run(tt.name, func(t *testing.T) { diff --git a/service/telemetry/internal/otelinit/testdata/bad_cert.crt b/service/telemetry/internal/otelinit/testdata/bad_cert.crt new file mode 100644 index 00000000000..e79f3ba5c04 --- /dev/null +++ b/service/telemetry/internal/otelinit/testdata/bad_cert.crt @@ -0,0 +1 @@ +This is intentionally not a PEM formatted cert file. \ No newline at end of file diff --git a/service/telemetry/internal/otelinit/testdata/ca.crt b/service/telemetry/internal/otelinit/testdata/ca.crt new file mode 100644 index 00000000000..2272f84e64d --- /dev/null +++ b/service/telemetry/internal/otelinit/testdata/ca.crt @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDNjCCAh4CCQC0I5IQT7eziDANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJB +VTESMBAGA1UECAwJQXVzdHJhbGlhMQ8wDQYDVQQHDAZTeWRuZXkxEjAQBgNVBAoM +CU15T3JnTmFtZTEVMBMGA1UEAwwMTXlDb21tb25OYW1lMB4XDTIyMDgwMzA0MTky +MVoXDTMyMDczMTA0MTkyMVowXTELMAkGA1UEBhMCQVUxEjAQBgNVBAgMCUF1c3Ry +YWxpYTEPMA0GA1UEBwwGU3lkbmV5MRIwEAYDVQQKDAlNeU9yZ05hbWUxFTATBgNV +BAMMDE15Q29tbW9uTmFtZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AMhGP0dy3zvkdx9zI+/XVjPOWlER0OUp7Sgzidc3nLOk42+bH4ofIVNtOFVqlNKi +O1bImu238VdBhd6R5IZZ1ZdIMcCeDgSJYu2X9wA3m4PKz8IdXo5ly2OHghhmCvqG +WxgqDj5wPXiczQwuf1EcDMtRWbXJ6Z/XH1U68R/kRdNLkiZ2LwtjoQpis5XYckLL +CrdF+AL6GeDIe0Mh9QGs26Vux+2kvaOGNUWRPE6Wt4GkqyKqmzYfR9HbflJ4xHT2 +I+jE1lg+jMBeom7z8Z90RE4GGcHjO+Vens/88r5EAjTnFj1Kb5gL2deSHY1m/++R +Z/kRyg+zQJyw4fAzlAA4+VkCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAM3gRdTKX +eGwGYVmmKqA2vTxeigQYLHml7OSopcWj2wJfxfp49HXPRuvgpQn9iubxO3Zmhd83 +2X1E+T0A8oy5CfxgpAhHb3lY0jm3TjKXm6m+dSODwL3uND8tX+SqR8sRTFxPvPuo +pmvhdTZoRI3EzIiHLTgCuSU25JNP/vrVoKk0JvCkDYTU/WcVfj0v95DTMoWR4JGz +mtBwrgD0EM2XRw5ZMc7sMPli1gqmCbCQUrDZ+rPB78WDCBILBd8Cz75qYTUp98BY +akJyBckdJHAdyEQYDKa9HpmpexOO7IhSXCTEN1DEBgpZgEi/lBDRG/b0OzenUUgt +LUABtWt3pNQ9HA== +-----END CERTIFICATE----- From b52e39c69cfb9a28c725ef0651f8fcf4ea086fd0 Mon Sep 17 00:00:00 2001 From: Jade Guiton Date: Thu, 28 Nov 2024 09:32:45 +0100 Subject: [PATCH 4/6] [chore] Add CI check to enforce merge freezes (#11744) #### Description As stated in the [Release Procedure document](https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/release.md#releasing-opentelemetry-collector), all merging in Core should be halted while the "Prepare release" PR is open. This PR adds a CI job checking the existence of such a PR, allowing us to enforce these freezes automatically. To make things simple, I decided to distinguish the "Prepare release" PR from others by using a new `prepare:merge-freeze` label. I modified the "Prepare release" action to include that label on the automatically created PR, but in rare cases where maintainers might create the PR themselves, the label can be added manually. Triagers will need to be careful not to accidentally add this label to any random PR to avoid artificial freezes. Because, in the current state, this CI check is run on each commit of a PR, and at no other time, there is a chance for: - False positives: If a commit is pushed during a freeze, and the freeze is later rescinded, the PR will remain unmergeable until a new commit is pushed. A simple solution is to re-run the check manually. - False negatives: If a commit is pushed outside of a freeze, then a freeze is enacted, the PR will remain mergeable despite the freeze. This is more problematic. To solve this second problem and make this check truly useful, two changes in the repository configuration are necessary: - the merge queue should be enabled, allowing us to run checks again just before merging; - this new CI check should be added to the list of required checks for the main branch. This will allow us to automatically cancel the merging of PRs during a freeze. A later PR on the community repository should take care of these configuration changes. Note that another solution to handle outdated CI checks would be to use a tool like [MergeFreeze](https://www.mergefreeze.com), but reading [this document](https://github.com/open-telemetry/community/blob/main/docs/using-github-extensions.md), it sounds like it would be a harder sell with the community than enabling the merge queue. #### Link to tracking issue Updates #11707 #### Testing Simple tests were made on a separate repository to check that enabling the merge queue fixes the false negatives. --------- Co-authored-by: Pablo Baeyens --- .github/workflows/check-merge-freeze.yml | 23 +++++++++++++++++++ .../workflows/scripts/check-merge-freeze.sh | 11 +++++++++ .../scripts/release-prepare-release.sh | 3 ++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/check-merge-freeze.yml create mode 100755 .github/workflows/scripts/check-merge-freeze.sh diff --git a/.github/workflows/check-merge-freeze.yml b/.github/workflows/check-merge-freeze.yml new file mode 100644 index 00000000000..c24b32dc718 --- /dev/null +++ b/.github/workflows/check-merge-freeze.yml @@ -0,0 +1,23 @@ +name: Merge freeze + +on: + pull_request: + types: [opened, ready_for_review, synchronize, reopened, labeled, unlabeled] + branches: [main] + merge_group: + types: [checks_requested] + +jobs: + check-merge-freeze: + name: Check + # This condition is to avoid blocking the PR causing the freeze in the first place. + if: ${{ !contains(github.event.pull_request.labels.*.name, 'release:merge-freeze') }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + sparse-checkout: .github/workflows/scripts + - run: ./.github/workflows/scripts/check-merge-freeze.sh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: open-telemetry/opentelemetry-collector diff --git a/.github/workflows/scripts/check-merge-freeze.sh b/.github/workflows/scripts/check-merge-freeze.sh new file mode 100755 index 00000000000..efd8927b17d --- /dev/null +++ b/.github/workflows/scripts/check-merge-freeze.sh @@ -0,0 +1,11 @@ +#!/bin/bash -e +# +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + +BLOCKERS=$( gh pr list --search "label:release:merge-freeze" --json url --jq '.[].url' --repo "${REPO}" ) +if [ "${BLOCKERS}" != "" ]; then + echo "Merging in main is frozen, as there are open PRs labeled 'release:merge-freeze': ${BLOCKERS}" + echo "If you believe this is no longer true, re-run this job to unblock your PR." + exit 1 +fi diff --git a/.github/workflows/scripts/release-prepare-release.sh b/.github/workflows/scripts/release-prepare-release.sh index 9f9d698cbb5..d3e7e1a72ea 100755 --- a/.github/workflows/scripts/release-prepare-release.sh +++ b/.github/workflows/scripts/release-prepare-release.sh @@ -41,7 +41,8 @@ if [ "${CANDIDATE_BETA}" != "" ]; then fi git push origin "${BRANCH}" -gh pr create --title "[chore] Prepare release ${RELEASE_VERSION}" --body " +# The `release:merge-freeze` label will cause the `check-merge-freeze` workflow to fail, enforcing the freeze. +gh pr create --title "[chore] Prepare release ${RELEASE_VERSION}" --label release:merge-freeze --body " The following commands were run to prepare this release: ${COMMANDS} " From 33264a5408cd918cfb45fd622b99f681c67d535c Mon Sep 17 00:00:00 2001 From: Damien Mathieu <42@dmathieu.com> Date: Thu, 28 Nov 2024 09:40:17 +0100 Subject: [PATCH 5/6] Upgrade pdata to proto 1.4.0 (#11722) This upgrades pdata to the [1.4.0](https://github.com/open-telemetry/opentelemetry-proto/releases/tag/v1.4.0) version of protobufs. Sorry for the very large PR. This can't really be split into smaller PRs though, as changes are not backwards compatible. This PR includes https://github.com/open-telemetry/opentelemetry-collector/pull/11706, as the two are very close and separating them would cause weird conflicts. The two changes can be merged either as separate PRs (with 11706 first), or as one. Closes https://github.com/open-telemetry/opentelemetry-collector/issues/11720 cc @mx-psi --------- Co-authored-by: Pablo Baeyens --- .chloggen/profiles-attributetable-slice.yaml | 25 + .chloggen/profiles-proto-1-4-0.yaml | 25 + Makefile | 4 +- .../debugexporter/internal/normal/profiles.go | 2 +- .../internal/normal/profiles_test.go | 4 +- .../internal/otlptext/databuffer.go | 44 +- .../internal/otlptext/profiles.go | 29 +- .../internal/otlptext/profiles_test.go | 53 +- .../testdata/profiles/two_profiles.out | 32 +- .../exporterhelperprofiles/profiles_batch.go | 6 +- .../cmd/pdatagen/internal/pcommon_package.go | 11 + .../cmd/pdatagen/internal/pprofile_package.go | 394 +- .../pdatagen/internal/pprofileotlp_package.go | 2 +- .../profiles_service.pb.go | 98 +- .../data/protogen/metrics/v1/metrics.pb.go | 25 +- .../profiles.pb.go} | 3518 ++++++++++------- .../profiles/v1experimental/profiles.pb.go | 1477 ------- .../internal/generated_wrapper_int32slice.go | 34 + pdata/internal/generated_wrapper_intslice.go | 34 + pdata/internal/otlp/profiles.go | 2 +- pdata/internal/otlp/profiles_test.go | 2 +- pdata/internal/wrapper_profiles.go | 4 +- pdata/pcommon/generated_int32slice.go | 108 + pdata/pcommon/generated_int32slice_test.go | 83 + pdata/pcommon/generated_intslice.go | 108 + pdata/pcommon/generated_intslice_test.go | 83 + pdata/pprofile/generated_attribute.go | 70 + pdata/pprofile/generated_attribute_test.go | 66 + ...ce.go => generated_attributetableslice.go} | 74 +- .../generated_attributetableslice_test.go | 137 + pdata/pprofile/generated_attributeunit.go | 30 +- .../pprofile/generated_attributeunit_test.go | 28 +- .../pprofile/generated_attributeunitslice.go | 2 +- .../generated_attributeunitslice_test.go | 2 +- pdata/pprofile/generated_function.go | 56 +- pdata/pprofile/generated_function_test.go | 48 +- pdata/pprofile/generated_functionslice.go | 2 +- .../pprofile/generated_functionslice_test.go | 2 +- pdata/pprofile/generated_label.go | 99 - pdata/pprofile/generated_label_test.go | 88 - pdata/pprofile/generated_line.go | 6 +- pdata/pprofile/generated_line_test.go | 12 +- pdata/pprofile/generated_lineslice.go | 2 +- pdata/pprofile/generated_lineslice_test.go | 2 +- pdata/pprofile/generated_link.go | 2 +- pdata/pprofile/generated_link_test.go | 2 +- pdata/pprofile/generated_linkslice.go | 2 +- pdata/pprofile/generated_linkslice_test.go | 2 +- pdata/pprofile/generated_location.go | 55 +- pdata/pprofile/generated_location_test.go | 45 +- pdata/pprofile/generated_locationslice.go | 2 +- .../pprofile/generated_locationslice_test.go | 2 +- pdata/pprofile/generated_mapping.go | 60 +- pdata/pprofile/generated_mapping_test.go | 54 +- pdata/pprofile/generated_mappingslice.go | 2 +- pdata/pprofile/generated_mappingslice_test.go | 2 +- pdata/pprofile/generated_profile.go | 145 +- pdata/pprofile/generated_profile_test.go | 149 +- pdata/pprofile/generated_profilecontainer.go | 113 - .../generated_profilecontainer_test.go | 104 - .../generated_profilescontainersslice_test.go | 154 - ...belslice.go => generated_profilesslice.go} | 66 +- ...est.go => generated_profilesslice_test.go} | 92 +- pdata/pprofile/generated_resourceprofiles.go | 2 +- .../generated_resourceprofiles_test.go | 2 +- .../generated_resourceprofilesslice.go | 2 +- .../generated_resourceprofilesslice_test.go | 2 +- pdata/pprofile/generated_sample.go | 54 +- pdata/pprofile/generated_sample_test.go | 68 +- pdata/pprofile/generated_sampleslice.go | 2 +- pdata/pprofile/generated_sampleslice_test.go | 2 +- pdata/pprofile/generated_scopeprofiles.go | 6 +- .../pprofile/generated_scopeprofiles_test.go | 10 +- .../pprofile/generated_scopeprofilesslice.go | 2 +- .../generated_scopeprofilesslice_test.go | 2 +- pdata/pprofile/generated_valuetype.go | 30 +- pdata/pprofile/generated_valuetype_test.go | 26 +- pdata/pprofile/generated_valuetypeslice.go | 2 +- .../pprofile/generated_valuetypeslice_test.go | 2 +- pdata/pprofile/json.go | 170 +- pdata/pprofile/json_test.go | 105 +- pdata/pprofile/pb.go | 2 +- pdata/pprofile/pb_test.go | 4 +- .../generated_exportpartialsuccess.go | 2 +- .../generated_exportpartialsuccess_test.go | 2 +- pdata/pprofile/pprofileotlp/grpc.go | 2 +- pdata/pprofile/pprofileotlp/request.go | 2 +- pdata/pprofile/pprofileotlp/request_test.go | 20 +- pdata/pprofile/pprofileotlp/response.go | 2 +- pdata/pprofile/profile.go | 19 + pdata/pprofile/profiles.go | 4 +- pdata/pprofile/profiles_test.go | 32 +- pdata/testdata/profile.go | 34 +- proto_patch.sed | 4 +- 94 files changed, 3848 insertions(+), 4756 deletions(-) create mode 100644 .chloggen/profiles-attributetable-slice.yaml create mode 100644 .chloggen/profiles-proto-1-4-0.yaml rename pdata/internal/data/protogen/collector/profiles/{v1experimental => v1development}/profiles_service.pb.go (84%) rename pdata/internal/data/protogen/profiles/{v1experimental/pprofextended.pb.go => v1development/profiles.pb.go} (56%) delete mode 100644 pdata/internal/data/protogen/profiles/v1experimental/profiles.pb.go create mode 100644 pdata/internal/generated_wrapper_int32slice.go create mode 100644 pdata/internal/generated_wrapper_intslice.go create mode 100644 pdata/pcommon/generated_int32slice.go create mode 100644 pdata/pcommon/generated_int32slice_test.go create mode 100644 pdata/pcommon/generated_intslice.go create mode 100644 pdata/pcommon/generated_intslice_test.go create mode 100644 pdata/pprofile/generated_attribute.go create mode 100644 pdata/pprofile/generated_attribute_test.go rename pdata/pprofile/{generated_profilescontainersslice.go => generated_attributetableslice.go} (50%) create mode 100644 pdata/pprofile/generated_attributetableslice_test.go delete mode 100644 pdata/pprofile/generated_label.go delete mode 100644 pdata/pprofile/generated_label_test.go delete mode 100644 pdata/pprofile/generated_profilecontainer.go delete mode 100644 pdata/pprofile/generated_profilecontainer_test.go delete mode 100644 pdata/pprofile/generated_profilescontainersslice_test.go rename pdata/pprofile/{generated_labelslice.go => generated_profilesslice.go} (61%) rename pdata/pprofile/{generated_labelslice_test.go => generated_profilesslice_test.go} (57%) create mode 100644 pdata/pprofile/profile.go diff --git a/.chloggen/profiles-attributetable-slice.yaml b/.chloggen/profiles-attributetable-slice.yaml new file mode 100644 index 00000000000..6dddb5ffc4c --- /dev/null +++ b/.chloggen/profiles-attributetable-slice.yaml @@ -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: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: pdata/pprofile + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: AttributeTable is now a slice rather than a map + +# One or more tracking issues or pull requests related to the change +issues: [11706] + +# (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] diff --git a/.chloggen/profiles-proto-1-4-0.yaml b/.chloggen/profiles-proto-1-4-0.yaml new file mode 100644 index 00000000000..25f5fc33ef0 --- /dev/null +++ b/.chloggen/profiles-proto-1-4-0.yaml @@ -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: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: pdata/pprofile + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Upgrade pdata to opentelemetry-proto v1.4.0 + +# One or more tracking issues or pull requests related to the change +issues: [11722] + +# (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: [user] diff --git a/Makefile b/Makefile index 71ace21781f..b48f1a586a0 100644 --- a/Makefile +++ b/Makefile @@ -171,10 +171,10 @@ ocb: OPENTELEMETRY_PROTO_SRC_DIR=pdata/internal/opentelemetry-proto # The branch matching the current version of the proto to use -OPENTELEMETRY_PROTO_VERSION=v1.3.1 +OPENTELEMETRY_PROTO_VERSION=v1.4.0 # Find all .proto files. -OPENTELEMETRY_PROTO_FILES := $(subst $(OPENTELEMETRY_PROTO_SRC_DIR)/,,$(wildcard $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1experimental/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1experimental/*.proto)) +OPENTELEMETRY_PROTO_FILES := $(subst $(OPENTELEMETRY_PROTO_SRC_DIR)/,,$(wildcard $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1development/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1development/*.proto)) # Target directory to write generated files to. PROTO_TARGET_GEN_DIR=pdata/internal/data/protogen diff --git a/exporter/debugexporter/internal/normal/profiles.go b/exporter/debugexporter/internal/normal/profiles.go index 43bc11aff28..b131e9c399c 100644 --- a/exporter/debugexporter/internal/normal/profiles.go +++ b/exporter/debugexporter/internal/normal/profiles.go @@ -33,7 +33,7 @@ func (normalProfilesMarshaler) MarshalProfiles(pd pprofile.Profiles) ([]byte, er buffer.WriteString(profile.ProfileID().String()) buffer.WriteString(" samples=") - buffer.WriteString(strconv.Itoa(profile.Profile().Sample().Len())) + buffer.WriteString(strconv.Itoa(profile.Sample().Len())) if profile.Attributes().Len() > 0 { profileAttributes := writeAttributes(profile.Attributes()) diff --git a/exporter/debugexporter/internal/normal/profiles_test.go b/exporter/debugexporter/internal/normal/profiles_test.go index bbe9e0bf8b2..22a649a586d 100644 --- a/exporter/debugexporter/internal/normal/profiles_test.go +++ b/exporter/debugexporter/internal/normal/profiles_test.go @@ -29,8 +29,8 @@ func TestMarshalProfiles(t *testing.T) { profiles := pprofile.NewProfiles() profile := profiles.ResourceProfiles().AppendEmpty().ScopeProfiles().AppendEmpty().Profiles().AppendEmpty() profile.SetProfileID([16]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10}) - profile.Profile().Sample().AppendEmpty() - profile.Profile().Sample().AppendEmpty() + profile.Sample().AppendEmpty() + profile.Sample().AppendEmpty() profile.Attributes().PutStr("key1", "value1") return profiles }(), diff --git a/exporter/debugexporter/internal/otlptext/databuffer.go b/exporter/debugexporter/internal/otlptext/databuffer.go index 37ca74449c2..1fc62942bf0 100644 --- a/exporter/debugexporter/internal/otlptext/databuffer.go +++ b/exporter/debugexporter/internal/otlptext/databuffer.go @@ -303,7 +303,7 @@ func (b *dataBuffer) logExemplars(description string, se pmetric.ExemplarSlice) } } -func (b *dataBuffer) logProfileSamples(ss pprofile.SampleSlice) { +func (b *dataBuffer) logProfileSamples(ss pprofile.SampleSlice, attrs pprofile.AttributeTableSlice) { if ss.Len() == 0 { return } @@ -312,21 +312,16 @@ func (b *dataBuffer) logProfileSamples(ss pprofile.SampleSlice) { b.logEntry(" Sample #%d", i) sample := ss.At(i) - b.logEntry(" Location index: %d", sample.LocationIndex().AsRaw()) b.logEntry(" Location length: %d", sample.LocationsLength()) - b.logEntry(" Stacktrace ID index: %d", sample.StacktraceIdIndex()) - if lb := sample.Label().Len(); lb > 0 { - for j := 0; j < lb; j++ { - b.logEntry(" Label #%d", j) - b.logEntry(" -> Key: %d", sample.Label().At(j).Key()) - b.logEntry(" -> Str: %d", sample.Label().At(j).Str()) - b.logEntry(" -> Num: %d", sample.Label().At(j).Num()) - b.logEntry(" -> Num unit: %d", sample.Label().At(j).NumUnit()) + b.logEntry(" Value: %d", sample.Value().AsRaw()) + + if lai := sample.AttributeIndices().Len(); lai > 0 { + b.logEntry(" Attributes:") + for j := 0; j < lai; j++ { + attr := attrs.At(int(sample.AttributeIndices().At(j))) + b.logEntry(" -> %s: %s", attr.Key(), attr.Value().AsRaw()) } } - b.logEntry(" Value: %d", sample.Value().AsRaw()) - b.logEntry(" Attributes: %d", sample.Attributes().AsRaw()) - b.logEntry(" Link: %d", sample.Link()) } } @@ -339,13 +334,11 @@ func (b *dataBuffer) logProfileMappings(ms pprofile.MappingSlice) { b.logEntry(" Mapping #%d", i) mapping := ms.At(i) - b.logEntry(" ID: %d", mapping.ID()) b.logEntry(" Memory start: %d", mapping.MemoryStart()) b.logEntry(" Memory limit: %d", mapping.MemoryLimit()) b.logEntry(" File offset: %d", mapping.FileOffset()) - b.logEntry(" File name: %d", mapping.Filename()) - b.logEntry(" Build ID: %d", mapping.BuildID()) - b.logEntry(" Attributes: %d", mapping.Attributes().AsRaw()) + b.logEntry(" File name: %d", mapping.FilenameStrindex()) + b.logEntry(" Attributes: %d", mapping.AttributeIndices().AsRaw()) b.logEntry(" Has functions: %t", mapping.HasFunctions()) b.logEntry(" Has filenames: %t", mapping.HasFilenames()) b.logEntry(" Has line numbers: %t", mapping.HasLineNumbers()) @@ -362,7 +355,6 @@ func (b *dataBuffer) logProfileLocations(ls pprofile.LocationSlice) { b.logEntry(" Location #%d", i) location := ls.At(i) - b.logEntry(" ID: %d", location.ID()) b.logEntry(" Mapping index: %d", location.MappingIndex()) b.logEntry(" Address: %d", location.Address()) if ll := location.Line().Len(); ll > 0 { @@ -375,8 +367,7 @@ func (b *dataBuffer) logProfileLocations(ls pprofile.LocationSlice) { } } b.logEntry(" Is folded: %t", location.IsFolded()) - b.logEntry(" Type index: %d", location.TypeIndex()) - b.logEntry(" Attributes: %d", location.Attributes().AsRaw()) + b.logEntry(" Attributes: %d", location.AttributeIndices().AsRaw()) } } @@ -389,10 +380,9 @@ func (b *dataBuffer) logProfileFunctions(fs pprofile.FunctionSlice) { b.logEntry(" Function #%d", i) function := fs.At(i) - b.logEntry(" ID: %d", function.ID()) - b.logEntry(" Name: %d", function.Name()) - b.logEntry(" System name: %d", function.SystemName()) - b.logEntry(" Filename: %d", function.Filename()) + b.logEntry(" Name: %d", function.NameStrindex()) + b.logEntry(" System name: %d", function.SystemNameStrindex()) + b.logEntry(" Filename: %d", function.FilenameStrindex()) b.logEntry(" Start line: %d", function.StartLine()) } } @@ -408,7 +398,7 @@ func (b *dataBuffer) logStringTable(ss pcommon.StringSlice) { } } -func (b *dataBuffer) logComment(c pcommon.Int64Slice) { +func (b *dataBuffer) logComment(c pcommon.Int32Slice) { if c.Len() == 0 { return } @@ -423,8 +413,8 @@ func attributeUnitsToMap(aus pprofile.AttributeUnitSlice) pcommon.Map { m := pcommon.NewMap() for i := 0; i < aus.Len(); i++ { au := aus.At(i) - m.PutInt("attributeKey", au.AttributeKey()) - m.PutInt("unit", au.Unit()) + m.PutInt("attributeKey", int64(au.AttributeKeyStrindex())) + m.PutInt("unit", int64(au.UnitStrindex())) } return m } diff --git a/exporter/debugexporter/internal/otlptext/profiles.go b/exporter/debugexporter/internal/otlptext/profiles.go index 7044709e31e..08e48d47c9b 100644 --- a/exporter/debugexporter/internal/otlptext/profiles.go +++ b/exporter/debugexporter/internal/otlptext/profiles.go @@ -36,36 +36,29 @@ func (textProfilesMarshaler) MarshalProfiles(pd pprofile.Profiles) ([]byte, erro buf.logEntry("Profile #%d", k) profile := profiles.At(k) buf.logAttr("Profile ID", profile.ProfileID()) - buf.logAttr("Start time", profile.StartTime().String()) - buf.logAttr("End time", profile.EndTime().String()) + buf.logAttr("Start time", profile.Time().String()) + buf.logAttr("Duration", profile.Duration().String()) buf.logAttributes("Attributes", profile.Attributes()) buf.logAttr("Dropped attributes count", strconv.FormatUint(uint64(profile.DroppedAttributesCount()), 10)) - buf.logEntry(" Location indices: %d", profile.Profile().LocationIndices().AsRaw()) - buf.logEntry(" Drop frames: %d", profile.Profile().DropFrames()) - buf.logEntry(" Keep frames: %d", profile.Profile().KeepFrames()) + buf.logEntry(" Location indices: %d", profile.LocationIndices().AsRaw()) - buf.logProfileSamples(profile.Profile().Sample()) - buf.logProfileMappings(profile.Profile().Mapping()) - buf.logProfileLocations(profile.Profile().Location()) - buf.logProfileFunctions(profile.Profile().Function()) - - buf.logAttributesWithIndentation( - "Attribute table", - profile.Profile().AttributeTable(), - 4) + buf.logProfileSamples(profile.Sample(), profile.AttributeTable()) + buf.logProfileMappings(profile.MappingTable()) + buf.logProfileLocations(profile.LocationTable()) + buf.logProfileFunctions(profile.FunctionTable()) buf.logAttributesWithIndentation( "Attribute units", - attributeUnitsToMap(profile.Profile().AttributeUnits()), + attributeUnitsToMap(profile.AttributeUnits()), 4) buf.logAttributesWithIndentation( "Link table", - linkTableToMap(profile.Profile().LinkTable()), + linkTableToMap(profile.LinkTable()), 4) - buf.logStringTable(profile.Profile().StringTable()) - buf.logComment(profile.Profile().Comment()) + buf.logStringTable(profile.StringTable()) + buf.logComment(profile.CommentStrindices()) } } } diff --git a/exporter/debugexporter/internal/otlptext/profiles_test.go b/exporter/debugexporter/internal/otlptext/profiles_test.go index 0a44252b3a9..4334eeaafbf 100644 --- a/exporter/debugexporter/internal/otlptext/profiles_test.go +++ b/exporter/debugexporter/internal/otlptext/profiles_test.go @@ -53,15 +53,9 @@ func extendProfiles(profiles pprofile.Profiles) pprofile.Profiles { switch i % 2 { case 0: profile := sc.Profiles().At(i) - profile.Profile().LocationIndices().FromRaw([]int64{1}) - label := profile.Profile().Sample().At(0).Label().AppendEmpty() - label.SetKey(1) - label.SetStr(2) - label.SetNum(3) - label.SetNumUnit(4) + profile.LocationIndices().FromRaw([]int32{1}) - location := profile.Profile().Location().AppendEmpty() - location.SetID(2) + location := profile.LocationTable().AppendEmpty() location.SetMappingIndex(3) location.SetAddress(4) line := location.Line().AppendEmpty() @@ -69,50 +63,43 @@ func extendProfiles(profiles pprofile.Profiles) pprofile.Profiles { line.SetLine(2) line.SetColumn(3) location.SetIsFolded(true) - location.SetTypeIndex(5) - location.Attributes().FromRaw([]uint64{6, 7}) + location.AttributeIndices().FromRaw([]int32{6, 7}) - _ = profile.Profile().AttributeTable().FromRaw(map[string]any{ - "value": map[string]any{ - "intValue": "42", - }, - }) + at := profile.AttributeTable() + a := at.AppendEmpty() + a.SetKey("intValue") + a.Value().SetInt(42) - attributeUnits := profile.Profile().AttributeUnits().AppendEmpty() - attributeUnits.SetAttributeKey(1) - attributeUnits.SetUnit(5) + attributeUnits := profile.AttributeUnits().AppendEmpty() + attributeUnits.SetAttributeKeyStrindex(1) + attributeUnits.SetUnitStrindex(5) - profile.Profile().StringTable().Append("foobar") + profile.StringTable().Append("foobar") case 1: profile := sc.Profiles().At(i) - profile.Profile().SetDropFrames(1) - profile.Profile().SetKeepFrames(2) - mapping := profile.Profile().Mapping().AppendEmpty() - mapping.SetID(1) + mapping := profile.MappingTable().AppendEmpty() mapping.SetMemoryStart(2) mapping.SetMemoryLimit(3) mapping.SetFileOffset(4) - mapping.SetFilename(5) - mapping.SetBuildID(6) - mapping.Attributes().FromRaw([]uint64{7, 8}) + mapping.SetFilenameStrindex(5) + mapping.AttributeIndices().FromRaw([]int32{7, 8}) mapping.SetHasFunctions(true) mapping.SetHasFilenames(true) mapping.SetHasLineNumbers(true) mapping.SetHasInlineFrames(true) - function := profile.Profile().Function().AppendEmpty() - function.SetID(1) - function.SetName(2) - function.SetSystemName(3) - function.SetFilename(4) + function := profile.FunctionTable().AppendEmpty() + function.SetNameStrindex(2) + function.SetSystemNameStrindex(3) + function.SetFilenameStrindex(4) function.SetStartLine(5) - linkTable := profile.Profile().LinkTable().AppendEmpty() + linkTable := profile.LinkTable().AppendEmpty() linkTable.SetTraceID([16]byte{0x03, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10}) linkTable.SetSpanID([8]byte{0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18}) - profile.Profile().Comment().FromRaw([]int64{1, 2}) + profile.CommentStrindices().FromRaw([]int32{1, 2}) } } return profiles diff --git a/exporter/debugexporter/internal/otlptext/testdata/profiles/two_profiles.out b/exporter/debugexporter/internal/otlptext/testdata/profiles/two_profiles.out index 81ef23433b4..7a5703e35e2 100644 --- a/exporter/debugexporter/internal/otlptext/testdata/profiles/two_profiles.out +++ b/exporter/debugexporter/internal/otlptext/testdata/profiles/two_profiles.out @@ -8,25 +8,15 @@ InstrumentationScope Profile #0 Profile ID : 0102030405060708090a0b0c0d0e0f10 Start time : 2020-02-11 20:26:12.000000321 +0000 UTC - End time : 2020-02-11 20:26:13.000000789 +0000 UTC + Duration : 2020-02-11 20:26:13.000000789 +0000 UTC Dropped attributes count: 1 Location indices: [1] - Drop frames: 0 - Keep frames: 0 Sample #0 - Location index: [1] Location length: 10 - Stacktrace ID index: 3 - Label #0 - -> Key: 1 - -> Str: 2 - -> Num: 3 - -> Num unit: 4 Value: [4] - Attributes: [5] - Link: 42 + Attributes: + -> key: value Location #0 - ID: 2 Mapping index: 3 Address: 4 Line #0 @@ -34,10 +24,7 @@ Profile #0 Line: 2 Column: 3 Is folded: true - Type index: 5 Attributes: [6 7] - Attribute table: - -> value: Map({"intValue":"42"}) Attribute units: -> attributeKey: Int(1) -> unit: Int(5) @@ -46,32 +33,25 @@ Profile #0 Profile #1 Profile ID : 0202030405060708090a0b0c0d0e0f10 Start time : 2020-02-11 20:26:12.000000321 +0000 UTC - End time : 2020-02-11 20:26:13.000000789 +0000 UTC + Duration : 2020-02-11 20:26:13.000000789 +0000 UTC Dropped attributes count: 0 Location indices: [] - Drop frames: 1 - Keep frames: 2 Sample #0 - Location index: [6] Location length: 20 - Stacktrace ID index: 8 Value: [9] - Attributes: [10] - Link: 44 + Attributes: + -> key: value Mapping #0 - ID: 1 Memory start: 2 Memory limit: 3 File offset: 4 File name: 5 - Build ID: 6 Attributes: [7 8] Has functions: true Has filenames: true Has line numbers: true Has inline frames: true Function #0 - ID: 1 Name: 2 System name: 3 Filename: 4 diff --git a/exporter/exporterhelper/exporterhelperprofiles/profiles_batch.go b/exporter/exporterhelper/exporterhelperprofiles/profiles_batch.go index fc725666438..f015f3b9cbe 100644 --- a/exporter/exporterhelper/exporterhelperprofiles/profiles_batch.go +++ b/exporter/exporterhelper/exporterhelperprofiles/profiles_batch.go @@ -117,7 +117,7 @@ func extractScopeProfiles(srcSS pprofile.ScopeProfiles, count int) pprofile.Scop destSS := pprofile.NewScopeProfiles() destSS.SetSchemaUrl(srcSS.SchemaUrl()) srcSS.Scope().CopyTo(destSS.Scope()) - srcSS.Profiles().RemoveIf(func(srcProfile pprofile.ProfileContainer) bool { + srcSS.Profiles().RemoveIf(func(srcProfile pprofile.Profile) bool { if count == 0 { return false } @@ -132,8 +132,8 @@ func extractScopeProfiles(srcSS pprofile.ScopeProfiles, count int) pprofile.Scop func samplesCount(rs pprofile.ResourceProfiles) int { count := 0 rs.ScopeProfiles().RemoveIf(func(ss pprofile.ScopeProfiles) bool { - ss.Profiles().RemoveIf(func(sp pprofile.ProfileContainer) bool { - count += sp.Profile().Sample().Len() + ss.Profiles().RemoveIf(func(sp pprofile.Profile) bool { + count += sp.Sample().Len() return false }) return false diff --git a/pdata/internal/cmd/pdatagen/internal/pcommon_package.go b/pdata/internal/cmd/pdatagen/internal/pcommon_package.go index d6085334f56..017c88201bc 100644 --- a/pdata/internal/cmd/pdatagen/internal/pcommon_package.go +++ b/pdata/internal/cmd/pdatagen/internal/pcommon_package.go @@ -27,6 +27,7 @@ var pcommon = &Package{ float64Slice, uInt64Slice, int64Slice, + int32Slice, stringSlice, }, } @@ -207,6 +208,16 @@ var int64Slice = &primitiveSliceStruct{ testNewVal: "1, 5, 3", } +var int32Slice = &primitiveSliceStruct{ + structName: "Int32Slice", + packageName: "pcommon", + itemType: "int32", + testOrigVal: "1, 2, 3", + testInterfaceOrigVal: []interface{}{1, 2, 3}, + testSetVal: "5", + testNewVal: "1, 5, 3", +} + var stringSlice = &primitiveSliceStruct{ structName: "StringSlice", packageName: "pcommon", diff --git a/pdata/internal/cmd/pdatagen/internal/pprofile_package.go b/pdata/internal/cmd/pdatagen/internal/pprofile_package.go index 7071021b27d..17003321256 100644 --- a/pdata/internal/cmd/pdatagen/internal/pprofile_package.go +++ b/pdata/internal/cmd/pdatagen/internal/pprofile_package.go @@ -10,7 +10,7 @@ var pprofile = &Package{ imports: []string{ `"go.opentelemetry.io/collector/pdata/internal"`, `"go.opentelemetry.io/collector/pdata/internal/data"`, - `otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental"`, + `otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development"`, `"go.opentelemetry.io/collector/pdata/pcommon"`, }, testImports: []string{ @@ -20,7 +20,7 @@ var pprofile = &Package{ `"github.com/stretchr/testify/assert"`, ``, `"go.opentelemetry.io/collector/pdata/internal"`, - `otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental"`, + `otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development"`, `"go.opentelemetry.io/collector/pdata/pcommon"`, }, }, @@ -29,15 +29,12 @@ var pprofile = &Package{ resourceProfiles, scopeProfilesSlice, scopeProfiles, - profilesContainersSlice, - profileContainer, + profilesSlice, profile, valueTypeSlice, valueType, sampleSlice, sample, - labelSlice, - label, mappingSlice, mapping, locationSlice, @@ -46,6 +43,8 @@ var pprofile = &Package{ line, functionSlice, function, + attributeTableSlice, + attribute, attributeUnitSlice, attributeUnit, linkSlice, @@ -86,48 +85,14 @@ var scopeProfiles = &messageValueStruct{ schemaURLField, &sliceField{ fieldName: "Profiles", - returnSlice: profilesContainersSlice, + returnSlice: profilesSlice, }, }, } -var profilesContainersSlice = &sliceOfPtrs{ - structName: "ProfilesContainersSlice", - element: profileContainer, -} - -var profileContainer = &messageValueStruct{ - structName: "ProfileContainer", - description: "// ProfileContainer are an experimental implementation of the OpenTelemetry Profiles Data Model.\n", - originFullName: "otlpprofiles.ProfileContainer", - fields: []baseField{ - &primitiveTypedField{ - fieldName: "ProfileID", - originFieldName: "ProfileId", - returnType: &primitiveType{ - structName: "ProfileID", - rawType: "data.ProfileID", - defaultVal: "data.ProfileID([16]byte{})", - testVal: "data.ProfileID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1})", - }, - }, - &primitiveTypedField{ - fieldName: "StartTime", - originFieldName: "StartTimeUnixNano", - returnType: timestampType, - }, - &primitiveTypedField{ - fieldName: "EndTime", - originFieldName: "EndTimeUnixNano", - returnType: timestampType, - }, - attributes, - droppedAttributesCount, - &messageValueField{ - fieldName: "Profile", - returnMessage: profile, - }, - }, +var profilesSlice = &sliceOfPtrs{ + structName: "ProfilesSlice", + element: profile, } var profile = &messageValueStruct{ @@ -144,24 +109,24 @@ var profile = &messageValueStruct{ returnSlice: sampleSlice, }, &sliceField{ - fieldName: "Mapping", + fieldName: "MappingTable", returnSlice: mappingSlice, }, &sliceField{ - fieldName: "Location", + fieldName: "LocationTable", returnSlice: locationSlice, }, &sliceField{ fieldName: "LocationIndices", - returnSlice: int64Slice, + returnSlice: int32Slice, }, &sliceField{ - fieldName: "Function", + fieldName: "FunctionTable", returnSlice: functionSlice, }, &sliceField{ fieldName: "AttributeTable", - returnSlice: mapStruct, + returnSlice: attributeTableSlice, }, &sliceField{ fieldName: "AttributeUnits", @@ -175,20 +140,8 @@ var profile = &messageValueStruct{ fieldName: "StringTable", returnSlice: stringSlice, }, - &primitiveField{ - fieldName: "DropFrames", - returnType: "int64", - defaultVal: "int64(0)", - testVal: "int64(1)", - }, - &primitiveField{ - fieldName: "KeepFrames", - returnType: "int64", - defaultVal: "int64(0)", - testVal: "int64(1)", - }, &primitiveTypedField{ - fieldName: "StartTime", + fieldName: "Time", originFieldName: "TimeNanos", returnType: &primitiveType{ structName: "Timestamp", @@ -209,6 +162,17 @@ var profile = &messageValueStruct{ testVal: "1234567890", }, }, + &primitiveTypedField{ + fieldName: "StartTime", + originFieldName: "TimeNanos", + returnType: &primitiveType{ + structName: "Timestamp", + packageName: "pcommon", + rawType: "int64", + defaultVal: "0", + testVal: "1234567890", + }, + }, &messageValueField{ fieldName: "PeriodType", returnMessage: valueType, @@ -220,18 +184,83 @@ var profile = &messageValueStruct{ testVal: "int64(1)", }, &sliceField{ - fieldName: "Comment", - returnSlice: int64Slice, + fieldName: "CommentStrindices", + returnSlice: int32Slice, }, &primitiveField{ - fieldName: "DefaultSampleType", - returnType: "int64", - defaultVal: "int64(0)", - testVal: "int64(1)", + fieldName: "DefaultSampleTypeStrindex", + returnType: "int32", + defaultVal: "int32(0)", + testVal: "int32(1)", + }, + &primitiveTypedField{ + fieldName: "ProfileID", + originFieldName: "ProfileId", + returnType: &primitiveType{ + structName: "ProfileID", + rawType: "data.ProfileID", + defaultVal: "data.ProfileID([16]byte{})", + testVal: "data.ProfileID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1})", + }, + }, + &sliceField{ + fieldName: "Attributes", + returnSlice: mapStruct, + }, + droppedAttributesCount, + &primitiveField{ + fieldName: "OriginalPayloadFormat", + returnType: "string", + defaultVal: `""`, + testVal: `"original payload"`, + }, + &sliceField{ + fieldName: "OriginalPayload", + returnSlice: byteSlice, }, }, } +var attributeUnitSlice = &sliceOfPtrs{ + structName: "AttributeUnitSlice", + element: attributeUnit, +} + +var attributeUnit = &messageValueStruct{ + structName: "AttributeUnit", + description: "// AttributeUnit Represents a mapping between Attribute Keys and Units.", + originFullName: "otlpprofiles.AttributeUnit", + fields: []baseField{ + &primitiveField{ + fieldName: "AttributeKeyStrindex", + returnType: "int32", + defaultVal: "int32(0)", + testVal: "int32(1)", + }, + &primitiveField{ + fieldName: "UnitStrindex", + returnType: "int32", + defaultVal: "int32(0)", + testVal: "int32(1)", + }, + }, +} + +var linkSlice = &sliceOfPtrs{ + structName: "LinkSlice", + element: link, +} + +var link = &messageValueStruct{ + structName: "Link", + description: "// Link represents a pointer from a profile Sample to a trace Span.", + originFullName: "otlpprofiles.Link", + fields: []baseField{ + traceIDField, + spanIDField, + }, +} + var valueTypeSlice = &sliceOfPtrs{ structName: "ValueTypeSlice", element: valueType, @@ -243,16 +272,16 @@ var valueType = &messageValueStruct{ originFullName: "otlpprofiles.ValueType", fields: []baseField{ &primitiveField{ - fieldName: "Type", - returnType: "int64", - defaultVal: "int64(0)", - testVal: "int64(1)", + fieldName: "TypeStrindex", + returnType: "int32", + defaultVal: "int32(0)", + testVal: "int32(1)", }, &primitiveField{ - fieldName: "Unit", - returnType: "int64", - defaultVal: "int64(0)", - testVal: "int64(1)", + fieldName: "UnitStrindex", + returnType: "int32", + defaultVal: "int32(0)", + testVal: "int32(1)", }, &primitiveField{ fieldName: "AggregationTemporality", @@ -273,45 +302,25 @@ var sample = &messageValueStruct{ description: "// Sample represents each record value encountered within a profiled program.", originFullName: "otlpprofiles.Sample", fields: []baseField{ - &sliceField{ - fieldName: "LocationIndex", - returnSlice: uInt64Slice, - }, &primitiveField{ fieldName: "LocationsStartIndex", - returnType: "uint64", - defaultVal: "uint64(0)", - testVal: "uint64(1)", + returnType: "int32", + defaultVal: "int32(0)", + testVal: "int32(1)", }, &primitiveField{ fieldName: "LocationsLength", - returnType: "uint64", - defaultVal: "uint64(0)", - testVal: "uint64(1)", - }, - &primitiveField{ - fieldName: "StacktraceIdIndex", - returnType: "uint32", - defaultVal: "uint32(0)", - testVal: "uint32(1)", + returnType: "int32", + defaultVal: "int32(0)", + testVal: "int32(1)", }, &sliceField{ fieldName: "Value", returnSlice: int64Slice, }, &sliceField{ - fieldName: "Label", - returnSlice: labelSlice, - }, - &sliceField{ - fieldName: "Attributes", - returnSlice: uInt64Slice, - }, - &primitiveField{ - fieldName: "Link", - returnType: "uint64", - defaultVal: "uint64(0)", - testVal: "uint64(1)", + fieldName: "AttributeIndices", + returnSlice: int32Slice, }, &sliceField{ fieldName: "TimestampsUnixNano", @@ -320,43 +329,6 @@ var sample = &messageValueStruct{ }, } -var labelSlice = &sliceOfPtrs{ - structName: "LabelSlice", - element: label, -} - -var label = &messageValueStruct{ - structName: "Label", - description: "// Label provided additional context for a sample", - originFullName: "otlpprofiles.Label", - fields: []baseField{ - &primitiveField{ - fieldName: "Key", - returnType: "int64", - defaultVal: "int64(0)", - testVal: "int64(1)", - }, - &primitiveField{ - fieldName: "Str", - returnType: "int64", - defaultVal: "int64(0)", - testVal: "int64(1)", - }, - &primitiveField{ - fieldName: "Num", - returnType: "int64", - defaultVal: "int64(0)", - testVal: "int64(1)", - }, - &primitiveField{ - fieldName: "NumUnit", - returnType: "int64", - defaultVal: "int64(0)", - testVal: "int64(1)", - }, - }, -} - var mappingSlice = &sliceOfPtrs{ structName: "MappingSlice", element: mapping, @@ -367,13 +339,6 @@ var mapping = &messageValueStruct{ description: "// Mapping describes the mapping of a binary in memory, including its address range, file offset, and metadata like build ID", originFullName: "otlpprofiles.Mapping", fields: []baseField{ - &primitiveField{ - fieldName: "ID", - originFieldName: "Id", - returnType: "uint64", - defaultVal: "uint64(0)", - testVal: "uint64(1)", - }, &primitiveField{ fieldName: "MemoryStart", returnType: "uint64", @@ -393,28 +358,14 @@ var mapping = &messageValueStruct{ testVal: "uint64(1)", }, &primitiveField{ - fieldName: "Filename", - returnType: "int64", - defaultVal: "int64(0)", - testVal: "int64(1)", - }, - &primitiveField{ - fieldName: "BuildID", - originFieldName: "BuildId", - returnType: "int64", - defaultVal: "int64(0)", - testVal: "int64(1)", - }, - &primitiveField{ - fieldName: "BuildIDKind", - originFieldName: "BuildIdKind", - returnType: "otlpprofiles.BuildIdKind", - defaultVal: "otlpprofiles.BuildIdKind(0)", - testVal: "otlpprofiles.BuildIdKind(1)", + fieldName: "FilenameStrindex", + returnType: "int32", + defaultVal: "int32(0)", + testVal: "int32(1)", }, &sliceField{ - fieldName: "Attributes", - returnSlice: uInt64Slice, + fieldName: "AttributeIndices", + returnSlice: int32Slice, }, &primitiveField{ fieldName: "HasFunctions", @@ -452,18 +403,11 @@ var location = &messageValueStruct{ description: "// Location describes function and line table debug information.", originFullName: "otlpprofiles.Location", fields: []baseField{ - &primitiveField{ - fieldName: "ID", - originFieldName: "Id", - returnType: "uint64", - defaultVal: "uint64(0)", - testVal: "uint64(1)", - }, - &primitiveField{ + &optionalPrimitiveValue{ fieldName: "MappingIndex", - returnType: "uint64", - defaultVal: "uint64(0)", - testVal: "uint64(1)", + returnType: "int32", + defaultVal: "int32(0)", + testVal: "int32(1)", }, &primitiveField{ fieldName: "Address", @@ -481,15 +425,9 @@ var location = &messageValueStruct{ defaultVal: "false", testVal: "true", }, - &primitiveField{ - fieldName: "TypeIndex", - returnType: "uint32", - defaultVal: "uint32(0)", - testVal: "uint32(1)", - }, &sliceField{ - fieldName: "Attributes", - returnSlice: uInt64Slice, + fieldName: "AttributeIndices", + returnSlice: int32Slice, }, }, } @@ -506,9 +444,9 @@ var line = &messageValueStruct{ fields: []baseField{ &primitiveField{ fieldName: "FunctionIndex", - returnType: "uint64", - defaultVal: "uint64(0)", - testVal: "uint64(1)", + returnType: "int32", + defaultVal: "int32(0)", + testVal: "int32(1)", }, &primitiveField{ fieldName: "Line", @@ -536,29 +474,22 @@ var function = &messageValueStruct{ originFullName: "otlpprofiles.Function", fields: []baseField{ &primitiveField{ - fieldName: "ID", - originFieldName: "Id", - returnType: "uint64", - defaultVal: "uint64(0)", - testVal: "uint64(1)", - }, - &primitiveField{ - fieldName: "Name", - returnType: "int64", - defaultVal: "int64(0)", - testVal: "int64(1)", + fieldName: "NameStrindex", + returnType: "int32", + defaultVal: "int32(0)", + testVal: "int32(1)", }, &primitiveField{ - fieldName: "SystemName", - returnType: "int64", - defaultVal: "int64(0)", - testVal: "int64(1)", + fieldName: "SystemNameStrindex", + returnType: "int32", + defaultVal: "int32(0)", + testVal: "int32(1)", }, &primitiveField{ - fieldName: "Filename", - returnType: "int64", - defaultVal: "int64(0)", - testVal: "int64(1)", + fieldName: "FilenameStrindex", + returnType: "int32", + defaultVal: "int32(0)", + testVal: "int32(1)", }, &primitiveField{ fieldName: "StartLine", @@ -569,42 +500,25 @@ var function = &messageValueStruct{ }, } -var attributeUnitSlice = &sliceOfPtrs{ - structName: "AttributeUnitSlice", - element: attributeUnit, +var attributeTableSlice = &sliceOfValues{ + structName: "AttributeTableSlice", + element: attribute, } -var attributeUnit = &messageValueStruct{ - structName: "AttributeUnit", - description: "// AttributeUnit Represents a mapping between Attribute Keys and Units.", - originFullName: "otlpprofiles.AttributeUnit", +var attribute = &messageValueStruct{ + structName: "Attribute", + description: "// Attribute describes an attribute stored in a profile's attribute table.", + originFullName: "v1.KeyValue", fields: []baseField{ &primitiveField{ - fieldName: "AttributeKey", - returnType: "int64", - defaultVal: "int64(0)", - testVal: "int64(1)", + fieldName: "Key", + returnType: "string", + defaultVal: `""`, + testVal: `"key"`, }, - &primitiveField{ - fieldName: "Unit", - returnType: "int64", - defaultVal: "int64(0)", - testVal: "int64(1)", + &messageValueField{ + fieldName: "Value", + returnMessage: anyValue, }, }, } - -var linkSlice = &sliceOfPtrs{ - structName: "LinkSlice", - element: link, -} - -var link = &messageValueStruct{ - structName: "Link", - description: "// Link represents a pointer from a profile Sample to a trace Span.", - originFullName: "otlpprofiles.Link", - fields: []baseField{ - traceIDField, - spanIDField, - }, -} diff --git a/pdata/internal/cmd/pdatagen/internal/pprofileotlp_package.go b/pdata/internal/cmd/pdatagen/internal/pprofileotlp_package.go index 9a94f3945a0..84d754e7d5a 100644 --- a/pdata/internal/cmd/pdatagen/internal/pprofileotlp_package.go +++ b/pdata/internal/cmd/pdatagen/internal/pprofileotlp_package.go @@ -11,7 +11,7 @@ var pprofileotlp = &Package{ name: "pprofileotlp", path: filepath.Join("pprofile", "pprofileotlp"), imports: []string{ - `otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1experimental"`, + `otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1development"`, }, testImports: []string{ `"testing"`, diff --git a/pdata/internal/data/protogen/collector/profiles/v1experimental/profiles_service.pb.go b/pdata/internal/data/protogen/collector/profiles/v1development/profiles_service.pb.go similarity index 84% rename from pdata/internal/data/protogen/collector/profiles/v1experimental/profiles_service.pb.go rename to pdata/internal/data/protogen/collector/profiles/v1development/profiles_service.pb.go index f998cd3f8c5..9e0475e6875 100644 --- a/pdata/internal/data/protogen/collector/profiles/v1experimental/profiles_service.pb.go +++ b/pdata/internal/data/protogen/collector/profiles/v1development/profiles_service.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: opentelemetry/proto/collector/profiles/v1experimental/profiles_service.proto +// source: opentelemetry/proto/collector/profiles/v1development/profiles_service.proto -package v1experimental +package v1development import ( context "context" @@ -16,7 +16,7 @@ import ( codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - v1experimental "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + v1development "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) // Reference imports to suppress errors if they are not otherwise used. @@ -36,14 +36,14 @@ type ExportProfilesServiceRequest struct { // element. Intermediary nodes (such as OpenTelemetry Collector) that receive // data from multiple origins typically batch the data before forwarding further and // in that case this array will contain multiple elements. - ResourceProfiles []*v1experimental.ResourceProfiles `protobuf:"bytes,1,rep,name=resource_profiles,json=resourceProfiles,proto3" json:"resource_profiles,omitempty"` + ResourceProfiles []*v1development.ResourceProfiles `protobuf:"bytes,1,rep,name=resource_profiles,json=resourceProfiles,proto3" json:"resource_profiles,omitempty"` } func (m *ExportProfilesServiceRequest) Reset() { *m = ExportProfilesServiceRequest{} } func (m *ExportProfilesServiceRequest) String() string { return proto.CompactTextString(m) } func (*ExportProfilesServiceRequest) ProtoMessage() {} func (*ExportProfilesServiceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3d903b74e05b443d, []int{0} + return fileDescriptor_ad3943ce836e7720, []int{0} } func (m *ExportProfilesServiceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -72,7 +72,7 @@ func (m *ExportProfilesServiceRequest) XXX_DiscardUnknown() { var xxx_messageInfo_ExportProfilesServiceRequest proto.InternalMessageInfo -func (m *ExportProfilesServiceRequest) GetResourceProfiles() []*v1experimental.ResourceProfiles { +func (m *ExportProfilesServiceRequest) GetResourceProfiles() []*v1development.ResourceProfiles { if m != nil { return m.ResourceProfiles } @@ -102,7 +102,7 @@ func (m *ExportProfilesServiceResponse) Reset() { *m = ExportProfilesSer func (m *ExportProfilesServiceResponse) String() string { return proto.CompactTextString(m) } func (*ExportProfilesServiceResponse) ProtoMessage() {} func (*ExportProfilesServiceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3d903b74e05b443d, []int{1} + return fileDescriptor_ad3943ce836e7720, []int{1} } func (m *ExportProfilesServiceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -158,7 +158,7 @@ func (m *ExportProfilesPartialSuccess) Reset() { *m = ExportProfilesPart func (m *ExportProfilesPartialSuccess) String() string { return proto.CompactTextString(m) } func (*ExportProfilesPartialSuccess) ProtoMessage() {} func (*ExportProfilesPartialSuccess) Descriptor() ([]byte, []int) { - return fileDescriptor_3d903b74e05b443d, []int{2} + return fileDescriptor_ad3943ce836e7720, []int{2} } func (m *ExportProfilesPartialSuccess) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -202,45 +202,45 @@ func (m *ExportProfilesPartialSuccess) GetErrorMessage() string { } func init() { - proto.RegisterType((*ExportProfilesServiceRequest)(nil), "opentelemetry.proto.collector.profiles.v1experimental.ExportProfilesServiceRequest") - proto.RegisterType((*ExportProfilesServiceResponse)(nil), "opentelemetry.proto.collector.profiles.v1experimental.ExportProfilesServiceResponse") - proto.RegisterType((*ExportProfilesPartialSuccess)(nil), "opentelemetry.proto.collector.profiles.v1experimental.ExportProfilesPartialSuccess") + proto.RegisterType((*ExportProfilesServiceRequest)(nil), "opentelemetry.proto.collector.profiles.v1development.ExportProfilesServiceRequest") + proto.RegisterType((*ExportProfilesServiceResponse)(nil), "opentelemetry.proto.collector.profiles.v1development.ExportProfilesServiceResponse") + proto.RegisterType((*ExportProfilesPartialSuccess)(nil), "opentelemetry.proto.collector.profiles.v1development.ExportProfilesPartialSuccess") } func init() { - proto.RegisterFile("opentelemetry/proto/collector/profiles/v1experimental/profiles_service.proto", fileDescriptor_3d903b74e05b443d) -} - -var fileDescriptor_3d903b74e05b443d = []byte{ - // 437 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0x3f, 0xcb, 0xd3, 0x40, - 0x18, 0xcf, 0xf5, 0x95, 0x17, 0xbc, 0xaa, 0xd5, 0xd0, 0xa1, 0x14, 0x8d, 0x25, 0x2e, 0x01, 0xe1, - 0x42, 0x2b, 0x05, 0x11, 0x5c, 0x2a, 0xdd, 0x14, 0x43, 0x5a, 0x1c, 0x44, 0x08, 0x31, 0x7d, 0x0c, - 0x29, 0x69, 0xee, 0xbc, 0xbb, 0x96, 0xba, 0x89, 0xa3, 0x93, 0x1f, 0xc2, 0xc9, 0xdd, 0xef, 0x50, - 0xb7, 0x8e, 0x4e, 0x22, 0xed, 0x17, 0x79, 0x49, 0xae, 0x09, 0x4d, 0x68, 0x29, 0x94, 0x6e, 0x77, - 0xbf, 0xe3, 0xf7, 0xe7, 0xf9, 0x1d, 0x0f, 0x7e, 0x4d, 0x19, 0x24, 0x12, 0x62, 0x98, 0x81, 0xe4, - 0x5f, 0x6c, 0xc6, 0xa9, 0xa4, 0x76, 0x40, 0xe3, 0x18, 0x02, 0x49, 0x79, 0x7a, 0xff, 0x14, 0xc5, - 0x20, 0xec, 0x45, 0x17, 0x96, 0x0c, 0x78, 0x34, 0x83, 0x44, 0xfa, 0x71, 0x81, 0x7b, 0x02, 0xf8, - 0x22, 0x0a, 0x80, 0x64, 0x44, 0xbd, 0x5f, 0x52, 0x53, 0x20, 0x29, 0xd4, 0x48, 0xce, 0x22, 0x65, - 0xb5, 0x76, 0x33, 0xa4, 0x21, 0x55, 0xd6, 0xe9, 0x49, 0xf1, 0xda, 0x2f, 0x0e, 0x45, 0x3b, 0x15, - 0x48, 0x71, 0xcd, 0xef, 0x08, 0x3f, 0x1c, 0x2e, 0x19, 0xe5, 0xd2, 0xd9, 0x3d, 0x8c, 0x54, 0x50, - 0x17, 0x3e, 0xcf, 0x41, 0x48, 0x7d, 0x8a, 0x1f, 0x70, 0x10, 0x74, 0xce, 0x03, 0xf0, 0x72, 0x6e, - 0x0b, 0x75, 0xae, 0xac, 0x7a, 0xef, 0x25, 0x39, 0x34, 0xc5, 0x91, 0xec, 0xc4, 0xdd, 0xa9, 0xe4, - 0x3e, 0xee, 0x7d, 0x5e, 0x41, 0xcc, 0x9f, 0x08, 0x3f, 0x3a, 0x12, 0x46, 0x30, 0x9a, 0x08, 0xd0, - 0xbf, 0x21, 0xdc, 0x60, 0x3e, 0x97, 0x91, 0x1f, 0x7b, 0x62, 0x1e, 0x04, 0x20, 0xd2, 0x30, 0xc8, - 0xaa, 0xf7, 0x46, 0xe4, 0xac, 0x4a, 0x49, 0xd9, 0xcf, 0x51, 0xda, 0x23, 0x25, 0x3d, 0xb8, 0xb5, - 0xfa, 0xf7, 0x58, 0x73, 0xef, 0xb1, 0x12, 0x6a, 0xb2, 0x6a, 0x65, 0x65, 0x96, 0xfe, 0x34, 0xad, - 0x6c, 0x0a, 0x81, 0x84, 0xc9, 0x7e, 0x65, 0xc8, 0xba, 0x4a, 0x67, 0x56, 0x0f, 0x39, 0x55, 0x7f, - 0x82, 0xef, 0x02, 0xe7, 0x94, 0x7b, 0x33, 0x10, 0xc2, 0x0f, 0xa1, 0x55, 0xeb, 0x20, 0xeb, 0xb6, - 0x7b, 0x27, 0x03, 0xdf, 0x28, 0xac, 0xf7, 0x07, 0xe1, 0x46, 0xa5, 0x12, 0xfd, 0x37, 0xc2, 0xd7, - 0x2a, 0x86, 0x7e, 0x99, 0xd9, 0xcb, 0x1f, 0xdf, 0x1e, 0x5f, 0x56, 0x54, 0x7d, 0xa0, 0xa9, 0x0d, - 0xbe, 0xd6, 0x56, 0x1b, 0x03, 0xad, 0x37, 0x06, 0xfa, 0xbf, 0x31, 0xd0, 0x8f, 0xad, 0xa1, 0xad, - 0xb7, 0x86, 0xf6, 0x77, 0x6b, 0x68, 0xf8, 0x79, 0x44, 0xcf, 0x33, 0x1d, 0x34, 0x2b, 0x7e, 0x4e, - 0xca, 0x73, 0xd0, 0xfb, 0x0f, 0x61, 0x55, 0x31, 0x2a, 0x6d, 0xed, 0xc4, 0x97, 0xbe, 0x1d, 0x25, - 0x12, 0x78, 0xe2, 0xc7, 0x76, 0x76, 0xcb, 0x2c, 0x43, 0x48, 0x4e, 0x2f, 0xf7, 0xaf, 0x5a, 0xff, - 0x2d, 0x83, 0x64, 0x5c, 0x68, 0x67, 0xae, 0xe4, 0x55, 0x91, 0x36, 0x0f, 0x45, 0xde, 0x75, 0x87, - 0x7b, 0xbc, 0x8f, 0xd7, 0x99, 0xc7, 0xb3, 0x9b, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8e, 0x3d, 0x57, - 0xb0, 0x54, 0x04, 0x00, 0x00, + proto.RegisterFile("opentelemetry/proto/collector/profiles/v1development/profiles_service.proto", fileDescriptor_ad3943ce836e7720) +} + +var fileDescriptor_ad3943ce836e7720 = []byte{ + // 438 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0x4d, 0x8b, 0xd3, 0x40, + 0x18, 0xce, 0xb4, 0x52, 0x70, 0xaa, 0x56, 0x43, 0x0f, 0xa5, 0x68, 0x2c, 0xf1, 0x12, 0x10, 0x26, + 0xb4, 0x16, 0x44, 0xf0, 0x54, 0xf5, 0x24, 0x62, 0x48, 0xc5, 0x83, 0x1e, 0x42, 0x4c, 0x5f, 0x43, + 0x24, 0xcd, 0x8c, 0x33, 0xd3, 0xa2, 0x47, 0x8f, 0xde, 0xf6, 0x3f, 0xec, 0x6d, 0xaf, 0xfb, 0x23, + 0xb6, 0xc7, 0x1e, 0xf7, 0xb4, 0x2c, 0xed, 0xef, 0x58, 0x58, 0x92, 0x69, 0xb2, 0x9b, 0xd0, 0xa5, + 0x50, 0x7a, 0x9b, 0x79, 0x86, 0xe7, 0xe3, 0x7d, 0x86, 0x17, 0x7f, 0xa4, 0x0c, 0x12, 0x09, 0x31, + 0x4c, 0x41, 0xf2, 0xbf, 0x36, 0xe3, 0x54, 0x52, 0x3b, 0xa0, 0x71, 0x0c, 0x81, 0xa4, 0x3c, 0xbd, + 0xff, 0x8c, 0x62, 0x10, 0xf6, 0xbc, 0x3f, 0x81, 0x39, 0xc4, 0x94, 0x4d, 0x21, 0x91, 0x05, 0xec, + 0x09, 0xe0, 0xf3, 0x28, 0x00, 0x92, 0xf1, 0xf4, 0x61, 0x49, 0x4c, 0x81, 0xa4, 0x10, 0x23, 0x39, + 0x8b, 0x94, 0xc4, 0xba, 0xed, 0x90, 0x86, 0x54, 0x19, 0xa7, 0x27, 0x45, 0xeb, 0xbe, 0xd9, 0x16, + 0x6c, 0x47, 0x1c, 0x45, 0x35, 0xff, 0x23, 0xfc, 0xf4, 0xc3, 0x1f, 0x46, 0xb9, 0x74, 0x36, 0x0f, + 0x63, 0x15, 0xd3, 0x85, 0xdf, 0x33, 0x10, 0x52, 0x8f, 0xf0, 0x13, 0x0e, 0x82, 0xce, 0x78, 0x00, + 0x5e, 0xce, 0xed, 0xa0, 0x5e, 0xdd, 0x6a, 0x0e, 0xde, 0x92, 0x6d, 0x33, 0x6c, 0x4f, 0x4e, 0xdc, + 0x8d, 0x48, 0x6e, 0xe3, 0x3e, 0xe6, 0x15, 0xc4, 0x3c, 0x46, 0xf8, 0xd9, 0x1d, 0x59, 0x04, 0xa3, + 0x89, 0x00, 0xfd, 0x1f, 0xc2, 0x2d, 0xe6, 0x73, 0x19, 0xf9, 0xb1, 0x27, 0x66, 0x41, 0x00, 0x22, + 0xcd, 0x82, 0xac, 0xe6, 0xc0, 0x25, 0xfb, 0xf4, 0x49, 0xca, 0x76, 0x8e, 0x92, 0x1e, 0x2b, 0xe5, + 0xd1, 0xbd, 0xc5, 0xc5, 0x73, 0xcd, 0x7d, 0xc4, 0x4a, 0xa8, 0xc9, 0xaa, 0x85, 0x95, 0x59, 0xfa, + 0xcb, 0xb4, 0xb0, 0x5f, 0x10, 0x48, 0x98, 0xdc, 0x2e, 0x0c, 0x59, 0xf5, 0x74, 0x64, 0xf5, 0x90, + 0x53, 0xf5, 0x17, 0xf8, 0x21, 0x70, 0x4e, 0xb9, 0x37, 0x05, 0x21, 0xfc, 0x10, 0x3a, 0xb5, 0x1e, + 0xb2, 0xee, 0xbb, 0x0f, 0x32, 0xf0, 0x93, 0xc2, 0x06, 0x67, 0x08, 0xb7, 0x2a, 0x8d, 0xe8, 0xa7, + 0x08, 0x37, 0x54, 0x0c, 0xfd, 0x20, 0xa3, 0x97, 0x7f, 0xbd, 0x3b, 0x3e, 0xa8, 0xa6, 0xfa, 0x3d, + 0x53, 0x1b, 0x5d, 0xa1, 0xc5, 0xca, 0x40, 0xcb, 0x95, 0x81, 0x2e, 0x57, 0x06, 0x3a, 0x5a, 0x1b, + 0xda, 0x72, 0x6d, 0x68, 0xe7, 0x6b, 0x43, 0xc3, 0xaf, 0x23, 0xba, 0x97, 0xe7, 0xa8, 0x5d, 0xb1, + 0x73, 0x52, 0x9a, 0x83, 0xbe, 0x7d, 0x0f, 0xab, 0x82, 0x51, 0x69, 0x5b, 0x27, 0xbe, 0xf4, 0xed, + 0x28, 0x91, 0xc0, 0x13, 0x3f, 0xb6, 0xb3, 0x5b, 0xe6, 0x18, 0x42, 0xb2, 0x73, 0xa9, 0x4f, 0x6a, + 0xc3, 0xcf, 0x0c, 0x92, 0x2f, 0x85, 0x74, 0x66, 0x4a, 0xde, 0x15, 0x59, 0xf3, 0x4c, 0xe4, 0x6b, + 0xff, 0xfd, 0x0d, 0xed, 0x47, 0x23, 0x73, 0x78, 0x75, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x8f, 0x35, + 0x8c, 0xea, 0x4a, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -270,7 +270,7 @@ func NewProfilesServiceClient(cc *grpc.ClientConn) ProfilesServiceClient { func (c *profilesServiceClient) Export(ctx context.Context, in *ExportProfilesServiceRequest, opts ...grpc.CallOption) (*ExportProfilesServiceResponse, error) { out := new(ExportProfilesServiceResponse) - err := c.cc.Invoke(ctx, "/opentelemetry.proto.collector.profiles.v1experimental.ProfilesService/Export", in, out, opts...) + err := c.cc.Invoke(ctx, "/opentelemetry.proto.collector.profiles.v1development.ProfilesService/Export", in, out, opts...) if err != nil { return nil, err } @@ -306,7 +306,7 @@ func _ProfilesService_Export_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/opentelemetry.proto.collector.profiles.v1experimental.ProfilesService/Export", + FullMethod: "/opentelemetry.proto.collector.profiles.v1development.ProfilesService/Export", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ProfilesServiceServer).Export(ctx, req.(*ExportProfilesServiceRequest)) @@ -315,7 +315,7 @@ func _ProfilesService_Export_Handler(srv interface{}, ctx context.Context, dec f } var _ProfilesService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "opentelemetry.proto.collector.profiles.v1experimental.ProfilesService", + ServiceName: "opentelemetry.proto.collector.profiles.v1development.ProfilesService", HandlerType: (*ProfilesServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -324,7 +324,7 @@ var _ProfilesService_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "opentelemetry/proto/collector/profiles/v1experimental/profiles_service.proto", + Metadata: "opentelemetry/proto/collector/profiles/v1development/profiles_service.proto", } func (m *ExportProfilesServiceRequest) Marshal() (dAtA []byte, err error) { @@ -549,7 +549,7 @@ func (m *ExportProfilesServiceRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ResourceProfiles = append(m.ResourceProfiles, &v1experimental.ResourceProfiles{}) + m.ResourceProfiles = append(m.ResourceProfiles, &v1development.ResourceProfiles{}) if err := m.ResourceProfiles[len(m.ResourceProfiles)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/pdata/internal/data/protogen/metrics/v1/metrics.pb.go b/pdata/internal/data/protogen/metrics/v1/metrics.pb.go index 3649bd83f81..66143337964 100644 --- a/pdata/internal/data/protogen/metrics/v1/metrics.pb.go +++ b/pdata/internal/data/protogen/metrics/v1/metrics.pb.go @@ -160,6 +160,25 @@ func (DataPointFlags) EnumDescriptor() ([]byte, []int) { // storage, OR can be embedded by other protocols that transfer OTLP metrics // data but do not implement the OTLP protocol. // +// MetricsData +// └─── ResourceMetrics +// +// ├── Resource +// ├── SchemaURL +// └── ScopeMetrics +// ├── Scope +// ├── SchemaURL +// └── Metric +// ├── Name +// ├── Description +// ├── Unit +// └── data +// ├── Gauge +// ├── Sum +// ├── Histogram +// ├── ExponentialHistogram +// └── Summary +// // The main difference between this message and collector protocol is that // in this message there will not be any "control" or "metadata" specific to // OTLP protocol. @@ -855,6 +874,9 @@ func (m *ExponentialHistogram) GetAggregationTemporality() AggregationTemporalit // data type. These data points cannot always be merged in a meaningful way. // While they can be useful in some applications, histogram data points are // recommended for new applications. +// Summary metrics do not have an aggregation temporality field. This is +// because the count and sum fields of a SummaryDataPoint are assumed to be +// cumulative values. type Summary struct { DataPoints []*SummaryDataPoint `protobuf:"bytes,1,rep,name=data_points,json=dataPoints,proto3" json:"data_points,omitempty"` } @@ -1644,7 +1666,8 @@ func (m *ExponentialHistogramDataPoint_Buckets) GetBucketCounts() []uint64 { } // SummaryDataPoint is a single data point in a timeseries that describes the -// time-varying values of a Summary metric. +// time-varying values of a Summary metric. The count and sum fields represent +// cumulative values. type SummaryDataPoint struct { // The set of key/value pairs that uniquely identify the timeseries from // where this point belongs. The list may be empty (may contain 0 elements). diff --git a/pdata/internal/data/protogen/profiles/v1experimental/pprofextended.pb.go b/pdata/internal/data/protogen/profiles/v1development/profiles.pb.go similarity index 56% rename from pdata/internal/data/protogen/profiles/v1experimental/pprofextended.pb.go rename to pdata/internal/data/protogen/profiles/v1development/profiles.pb.go index 7b90b35373f..faa8630469c 100644 --- a/pdata/internal/data/protogen/profiles/v1experimental/pprofextended.pb.go +++ b/pdata/internal/data/protogen/profiles/v1development/profiles.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: opentelemetry/proto/profiles/v1experimental/pprofextended.proto +// source: opentelemetry/proto/profiles/v1development/profiles.proto -package v1experimental +package v1development import ( fmt "fmt" @@ -13,7 +13,8 @@ import ( proto "github.com/gogo/protobuf/proto" go_opentelemetry_io_collector_pdata_internal_data "go.opentelemetry.io/collector/pdata/internal/data" - v1 "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" + v11 "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" + v1 "go.opentelemetry.io/collector/pdata/internal/data/protogen/resource/v1" ) // Reference imports to suppress errors if they are not otherwise used. @@ -88,7 +89,7 @@ const ( //11. A request is received, the system measures 1 request. //12. The 1 second collection cycle ends. A metric is exported for the //number of requests received over the interval of time t_1 to - //t_0+1 with a value of 1. + //t_1+1 with a value of 1. // //Note: Even though, when reporting changes since last report time, using //CUMULATIVE is valid, it is not recommended. @@ -112,42 +113,213 @@ func (x AggregationTemporality) String() string { } func (AggregationTemporality) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_05f9ce3fdbeb046f, []int{0} + return fileDescriptor_ddd0cf081a2fe76f, []int{0} +} + +// ProfilesData represents the profiles data that can be stored in persistent storage, +// OR can be embedded by other protocols that transfer OTLP profiles data but do not +// implement the OTLP protocol. +// +// The main difference between this message and collector protocol is that +// in this message there will not be any "control" or "metadata" specific to +// OTLP protocol. +// +// When new fields are added into this message, the OTLP request MUST be updated +// as well. +type ProfilesData struct { + // An array of ResourceProfiles. + // For data coming from a single resource this array will typically contain + // one element. Intermediary nodes that receive data from multiple origins + // typically batch the data before forwarding further and in that case this + // array will contain multiple elements. + ResourceProfiles []*ResourceProfiles `protobuf:"bytes,1,rep,name=resource_profiles,json=resourceProfiles,proto3" json:"resource_profiles,omitempty"` +} + +func (m *ProfilesData) Reset() { *m = ProfilesData{} } +func (m *ProfilesData) String() string { return proto.CompactTextString(m) } +func (*ProfilesData) ProtoMessage() {} +func (*ProfilesData) Descriptor() ([]byte, []int) { + return fileDescriptor_ddd0cf081a2fe76f, []int{0} +} +func (m *ProfilesData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProfilesData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProfilesData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ProfilesData) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProfilesData.Merge(m, src) +} +func (m *ProfilesData) XXX_Size() int { + return m.Size() +} +func (m *ProfilesData) XXX_DiscardUnknown() { + xxx_messageInfo_ProfilesData.DiscardUnknown(m) } -// Indicates the semantics of the build_id field. -type BuildIdKind int32 +var xxx_messageInfo_ProfilesData proto.InternalMessageInfo -const ( - // Linker-generated build ID, stored in the ELF binary notes. - BuildIdKind_BUILD_ID_LINKER BuildIdKind = 0 - // Build ID based on the content hash of the binary. Currently no particular - // hashing approach is standardized, so a given producer needs to define it - // themselves and thus unlike BUILD_ID_LINKER this kind of hash is producer-specific. - // We may choose to provide a standardized stable hash recommendation later. - BuildIdKind_BUILD_ID_BINARY_HASH BuildIdKind = 1 -) +func (m *ProfilesData) GetResourceProfiles() []*ResourceProfiles { + if m != nil { + return m.ResourceProfiles + } + return nil +} + +// A collection of ScopeProfiles from a Resource. +type ResourceProfiles struct { + // The resource for the profiles in this message. + // If this field is not set then no resource info is known. + Resource v1.Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource"` + // A list of ScopeProfiles that originate from a resource. + ScopeProfiles []*ScopeProfiles `protobuf:"bytes,2,rep,name=scope_profiles,json=scopeProfiles,proto3" json:"scope_profiles,omitempty"` + // The Schema URL, if known. This is the identifier of the Schema that the resource data + // is recorded in. To learn more about Schema URL see + // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url + // This schema_url applies to the data in the "resource" field. It does not apply + // to the data in the "scope_profiles" field which have their own schema_url field. + SchemaUrl string `protobuf:"bytes,3,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"` +} + +func (m *ResourceProfiles) Reset() { *m = ResourceProfiles{} } +func (m *ResourceProfiles) String() string { return proto.CompactTextString(m) } +func (*ResourceProfiles) ProtoMessage() {} +func (*ResourceProfiles) Descriptor() ([]byte, []int) { + return fileDescriptor_ddd0cf081a2fe76f, []int{1} +} +func (m *ResourceProfiles) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResourceProfiles) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResourceProfiles.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ResourceProfiles) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourceProfiles.Merge(m, src) +} +func (m *ResourceProfiles) XXX_Size() int { + return m.Size() +} +func (m *ResourceProfiles) XXX_DiscardUnknown() { + xxx_messageInfo_ResourceProfiles.DiscardUnknown(m) +} + +var xxx_messageInfo_ResourceProfiles proto.InternalMessageInfo + +func (m *ResourceProfiles) GetResource() v1.Resource { + if m != nil { + return m.Resource + } + return v1.Resource{} +} + +func (m *ResourceProfiles) GetScopeProfiles() []*ScopeProfiles { + if m != nil { + return m.ScopeProfiles + } + return nil +} -var BuildIdKind_name = map[int32]string{ - 0: "BUILD_ID_LINKER", - 1: "BUILD_ID_BINARY_HASH", +func (m *ResourceProfiles) GetSchemaUrl() string { + if m != nil { + return m.SchemaUrl + } + return "" +} + +// A collection of Profiles produced by an InstrumentationScope. +type ScopeProfiles struct { + // The instrumentation scope information for the profiles in this message. + // Semantically when InstrumentationScope isn't set, it is equivalent with + // an empty instrumentation scope name (unknown). + Scope v11.InstrumentationScope `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope"` + // A list of Profiles that originate from an instrumentation scope. + Profiles []*Profile `protobuf:"bytes,2,rep,name=profiles,proto3" json:"profiles,omitempty"` + // The Schema URL, if known. This is the identifier of the Schema that the profile data + // is recorded in. To learn more about Schema URL see + // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url + // This schema_url applies to all profiles in the "profiles" field. + SchemaUrl string `protobuf:"bytes,3,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"` +} + +func (m *ScopeProfiles) Reset() { *m = ScopeProfiles{} } +func (m *ScopeProfiles) String() string { return proto.CompactTextString(m) } +func (*ScopeProfiles) ProtoMessage() {} +func (*ScopeProfiles) Descriptor() ([]byte, []int) { + return fileDescriptor_ddd0cf081a2fe76f, []int{2} +} +func (m *ScopeProfiles) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ScopeProfiles) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ScopeProfiles.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ScopeProfiles) XXX_Merge(src proto.Message) { + xxx_messageInfo_ScopeProfiles.Merge(m, src) +} +func (m *ScopeProfiles) XXX_Size() int { + return m.Size() +} +func (m *ScopeProfiles) XXX_DiscardUnknown() { + xxx_messageInfo_ScopeProfiles.DiscardUnknown(m) } -var BuildIdKind_value = map[string]int32{ - "BUILD_ID_LINKER": 0, - "BUILD_ID_BINARY_HASH": 1, +var xxx_messageInfo_ScopeProfiles proto.InternalMessageInfo + +func (m *ScopeProfiles) GetScope() v11.InstrumentationScope { + if m != nil { + return m.Scope + } + return v11.InstrumentationScope{} } -func (x BuildIdKind) String() string { - return proto.EnumName(BuildIdKind_name, int32(x)) +func (m *ScopeProfiles) GetProfiles() []*Profile { + if m != nil { + return m.Profiles + } + return nil } -func (BuildIdKind) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_05f9ce3fdbeb046f, []int{1} +func (m *ScopeProfiles) GetSchemaUrl() string { + if m != nil { + return m.SchemaUrl + } + return "" } // Represents a complete profile, including sample types, samples, // mappings to binaries, locations, functions, string table, and additional metadata. +// It modifies and annotates pprof Profile with OpenTelemetry specific fields. +// +// Note that whilst fields in this message retain the name and field id from pprof in most cases +// for ease of understanding data migration, it is not intended that pprof:Profile and +// OpenTelemetry:Profile encoding be wire compatible. type Profile struct { // A description of the samples associated with each Sample.value. // For a cpu profile this might be: @@ -162,53 +334,80 @@ type Profile struct { Sample []*Sample `protobuf:"bytes,2,rep,name=sample,proto3" json:"sample,omitempty"` // Mapping from address ranges to the image/binary/library mapped // into that address range. mapping[0] will be the main binary. - Mapping []*Mapping `protobuf:"bytes,3,rep,name=mapping,proto3" json:"mapping,omitempty"` + // If multiple binaries contribute to the Profile and no main + // binary can be identified, mapping[0] has no special meaning. + MappingTable []*Mapping `protobuf:"bytes,3,rep,name=mapping_table,json=mappingTable,proto3" json:"mapping_table,omitempty"` // Locations referenced by samples via location_indices. - Location []*Location `protobuf:"bytes,4,rep,name=location,proto3" json:"location,omitempty"` + LocationTable []*Location `protobuf:"bytes,4,rep,name=location_table,json=locationTable,proto3" json:"location_table,omitempty"` // Array of locations referenced by samples. - LocationIndices []int64 `protobuf:"varint,15,rep,packed,name=location_indices,json=locationIndices,proto3" json:"location_indices,omitempty"` + LocationIndices []int32 `protobuf:"varint,5,rep,packed,name=location_indices,json=locationIndices,proto3" json:"location_indices,omitempty"` // Functions referenced by locations. - Function []*Function `protobuf:"bytes,5,rep,name=function,proto3" json:"function,omitempty"` + FunctionTable []*Function `protobuf:"bytes,6,rep,name=function_table,json=functionTable,proto3" json:"function_table,omitempty"` // Lookup table for attributes. - AttributeTable []v1.KeyValue `protobuf:"bytes,16,rep,name=attribute_table,json=attributeTable,proto3" json:"attribute_table"` + AttributeTable []v11.KeyValue `protobuf:"bytes,7,rep,name=attribute_table,json=attributeTable,proto3" json:"attribute_table"` // Represents a mapping between Attribute Keys and Units. - AttributeUnits []*AttributeUnit `protobuf:"bytes,17,rep,name=attribute_units,json=attributeUnits,proto3" json:"attribute_units,omitempty"` + AttributeUnits []*AttributeUnit `protobuf:"bytes,8,rep,name=attribute_units,json=attributeUnits,proto3" json:"attribute_units,omitempty"` // Lookup table for links. - LinkTable []*Link `protobuf:"bytes,18,rep,name=link_table,json=linkTable,proto3" json:"link_table,omitempty"` + LinkTable []*Link `protobuf:"bytes,9,rep,name=link_table,json=linkTable,proto3" json:"link_table,omitempty"` // A common table for strings referenced by various messages. // string_table[0] must always be "". - StringTable []string `protobuf:"bytes,6,rep,name=string_table,json=stringTable,proto3" json:"string_table,omitempty"` - // frames with Function.function_name fully matching the following - // regexp will be dropped from the samples, along with their successors. - DropFrames int64 `protobuf:"varint,7,opt,name=drop_frames,json=dropFrames,proto3" json:"drop_frames,omitempty"` - // frames with Function.function_name fully matching the following - // regexp will be kept, even if it matches drop_frames. - KeepFrames int64 `protobuf:"varint,8,opt,name=keep_frames,json=keepFrames,proto3" json:"keep_frames,omitempty"` + StringTable []string `protobuf:"bytes,10,rep,name=string_table,json=stringTable,proto3" json:"string_table,omitempty"` // Time of collection (UTC) represented as nanoseconds past the epoch. - TimeNanos int64 `protobuf:"varint,9,opt,name=time_nanos,json=timeNanos,proto3" json:"time_nanos,omitempty"` + TimeNanos int64 `protobuf:"varint,11,opt,name=time_nanos,json=timeNanos,proto3" json:"time_nanos,omitempty"` // Duration of the profile, if a duration makes sense. - DurationNanos int64 `protobuf:"varint,10,opt,name=duration_nanos,json=durationNanos,proto3" json:"duration_nanos,omitempty"` + DurationNanos int64 `protobuf:"varint,12,opt,name=duration_nanos,json=durationNanos,proto3" json:"duration_nanos,omitempty"` // The kind of events between sampled occurrences. // e.g [ "cpu","cycles" ] or [ "heap","bytes" ] - PeriodType ValueType `protobuf:"bytes,11,opt,name=period_type,json=periodType,proto3" json:"period_type"` + PeriodType ValueType `protobuf:"bytes,13,opt,name=period_type,json=periodType,proto3" json:"period_type"` // The number of events between sampled occurrences. - Period int64 `protobuf:"varint,12,opt,name=period,proto3" json:"period,omitempty"` + Period int64 `protobuf:"varint,14,opt,name=period,proto3" json:"period,omitempty"` // Free-form text associated with the profile. The text is displayed as is // to the user by the tools that read profiles (e.g. by pprof). This field // should not be used to store any machine-readable information, it is only // for human-friendly content. The profile must stay functional if this field // is cleaned. - Comment []int64 `protobuf:"varint,13,rep,packed,name=comment,proto3" json:"comment,omitempty"` + CommentStrindices []int32 `protobuf:"varint,15,rep,packed,name=comment_strindices,json=commentStrindices,proto3" json:"comment_strindices,omitempty"` // Index into the string table of the type of the preferred sample // value. If unset, clients should default to the last sample value. - DefaultSampleType int64 `protobuf:"varint,14,opt,name=default_sample_type,json=defaultSampleType,proto3" json:"default_sample_type,omitempty"` + DefaultSampleTypeStrindex int32 `protobuf:"varint,16,opt,name=default_sample_type_strindex,json=defaultSampleTypeStrindex,proto3" json:"default_sample_type_strindex,omitempty"` + // A globally unique identifier for a profile. The ID is a 16-byte array. An ID with + // all zeroes is considered invalid. + // + // This field is required. + ProfileId go_opentelemetry_io_collector_pdata_internal_data.ProfileID `protobuf:"bytes,17,opt,name=profile_id,json=profileId,proto3,customtype=go.opentelemetry.io/collector/pdata/internal/data.ProfileID" json:"profile_id"` + // attributes is a collection of key/value pairs. Note, global attributes + // like server name can be set using the resource API. Examples of attributes: + // + // "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" + // "/http/server_latency": 300 + // "abc.com/myattribute": true + // "abc.com/score": 10.239 + // + // The OpenTelemetry API specification further restricts the allowed value types: + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute + // Attribute keys MUST be unique (it is not allowed to have more than one + // attribute with the same key). + Attributes []v11.KeyValue `protobuf:"bytes,18,rep,name=attributes,proto3" json:"attributes"` + // dropped_attributes_count is the number of attributes that were discarded. Attributes + // can be discarded because their keys are too long or because there are too many + // attributes. If this value is 0, then no attributes were dropped. + DroppedAttributesCount uint32 `protobuf:"varint,19,opt,name=dropped_attributes_count,json=droppedAttributesCount,proto3" json:"dropped_attributes_count,omitempty"` + // Specifies format of the original payload. Common values are defined in semantic conventions. [required if original_payload is present] + OriginalPayloadFormat string `protobuf:"bytes,20,opt,name=original_payload_format,json=originalPayloadFormat,proto3" json:"original_payload_format,omitempty"` + // Original payload can be stored in this field. This can be useful for users who want to get the original payload. + // Formats such as JFR are highly extensible and can contain more information than what is defined in this spec. + // Inclusion of original payload should be configurable by the user. Default behavior should be to not include the original payload. + // If the original payload is in pprof format, it SHOULD not be included in this field. + // The field is optional, however if it is present then equivalent converted data should be populated in other fields + // of this message as far as is practicable. + OriginalPayload []byte `protobuf:"bytes,21,opt,name=original_payload,json=originalPayload,proto3" json:"original_payload,omitempty"` } func (m *Profile) Reset() { *m = Profile{} } func (m *Profile) String() string { return proto.CompactTextString(m) } func (*Profile) ProtoMessage() {} func (*Profile) Descriptor() ([]byte, []int) { - return fileDescriptor_05f9ce3fdbeb046f, []int{0} + return fileDescriptor_ddd0cf081a2fe76f, []int{3} } func (m *Profile) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -251,35 +450,35 @@ func (m *Profile) GetSample() []*Sample { return nil } -func (m *Profile) GetMapping() []*Mapping { +func (m *Profile) GetMappingTable() []*Mapping { if m != nil { - return m.Mapping + return m.MappingTable } return nil } -func (m *Profile) GetLocation() []*Location { +func (m *Profile) GetLocationTable() []*Location { if m != nil { - return m.Location + return m.LocationTable } return nil } -func (m *Profile) GetLocationIndices() []int64 { +func (m *Profile) GetLocationIndices() []int32 { if m != nil { return m.LocationIndices } return nil } -func (m *Profile) GetFunction() []*Function { +func (m *Profile) GetFunctionTable() []*Function { if m != nil { - return m.Function + return m.FunctionTable } return nil } -func (m *Profile) GetAttributeTable() []v1.KeyValue { +func (m *Profile) GetAttributeTable() []v11.KeyValue { if m != nil { return m.AttributeTable } @@ -307,20 +506,6 @@ func (m *Profile) GetStringTable() []string { return nil } -func (m *Profile) GetDropFrames() int64 { - if m != nil { - return m.DropFrames - } - return 0 -} - -func (m *Profile) GetKeepFrames() int64 { - if m != nil { - return m.KeepFrames - } - return 0 -} - func (m *Profile) GetTimeNanos() int64 { if m != nil { return m.TimeNanos @@ -349,33 +534,61 @@ func (m *Profile) GetPeriod() int64 { return 0 } -func (m *Profile) GetComment() []int64 { +func (m *Profile) GetCommentStrindices() []int32 { + if m != nil { + return m.CommentStrindices + } + return nil +} + +func (m *Profile) GetDefaultSampleTypeStrindex() int32 { + if m != nil { + return m.DefaultSampleTypeStrindex + } + return 0 +} + +func (m *Profile) GetAttributes() []v11.KeyValue { if m != nil { - return m.Comment + return m.Attributes } return nil } -func (m *Profile) GetDefaultSampleType() int64 { +func (m *Profile) GetDroppedAttributesCount() uint32 { if m != nil { - return m.DefaultSampleType + return m.DroppedAttributesCount } return 0 } +func (m *Profile) GetOriginalPayloadFormat() string { + if m != nil { + return m.OriginalPayloadFormat + } + return "" +} + +func (m *Profile) GetOriginalPayload() []byte { + if m != nil { + return m.OriginalPayload + } + return nil +} + // Represents a mapping between Attribute Keys and Units. type AttributeUnit struct { // Index into string table. - AttributeKey int64 `protobuf:"varint,1,opt,name=attribute_key,json=attributeKey,proto3" json:"attribute_key,omitempty"` + AttributeKeyStrindex int32 `protobuf:"varint,1,opt,name=attribute_key_strindex,json=attributeKeyStrindex,proto3" json:"attribute_key_strindex,omitempty"` // Index into string table. - Unit int64 `protobuf:"varint,2,opt,name=unit,proto3" json:"unit,omitempty"` + UnitStrindex int32 `protobuf:"varint,2,opt,name=unit_strindex,json=unitStrindex,proto3" json:"unit_strindex,omitempty"` } func (m *AttributeUnit) Reset() { *m = AttributeUnit{} } func (m *AttributeUnit) String() string { return proto.CompactTextString(m) } func (*AttributeUnit) ProtoMessage() {} func (*AttributeUnit) Descriptor() ([]byte, []int) { - return fileDescriptor_05f9ce3fdbeb046f, []int{1} + return fileDescriptor_ddd0cf081a2fe76f, []int{4} } func (m *AttributeUnit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -404,16 +617,16 @@ func (m *AttributeUnit) XXX_DiscardUnknown() { var xxx_messageInfo_AttributeUnit proto.InternalMessageInfo -func (m *AttributeUnit) GetAttributeKey() int64 { +func (m *AttributeUnit) GetAttributeKeyStrindex() int32 { if m != nil { - return m.AttributeKey + return m.AttributeKeyStrindex } return 0 } -func (m *AttributeUnit) GetUnit() int64 { +func (m *AttributeUnit) GetUnitStrindex() int32 { if m != nil { - return m.Unit + return m.UnitStrindex } return 0 } @@ -432,7 +645,7 @@ func (m *Link) Reset() { *m = Link{} } func (m *Link) String() string { return proto.CompactTextString(m) } func (*Link) ProtoMessage() {} func (*Link) Descriptor() ([]byte, []int) { - return fileDescriptor_05f9ce3fdbeb046f, []int{2} + return fileDescriptor_ddd0cf081a2fe76f, []int{5} } func (m *Link) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -463,16 +676,16 @@ var xxx_messageInfo_Link proto.InternalMessageInfo // ValueType describes the type and units of a value, with an optional aggregation temporality. type ValueType struct { - Type int64 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` - Unit int64 `protobuf:"varint,2,opt,name=unit,proto3" json:"unit,omitempty"` - AggregationTemporality AggregationTemporality `protobuf:"varint,3,opt,name=aggregation_temporality,json=aggregationTemporality,proto3,enum=opentelemetry.proto.profiles.v1experimental.AggregationTemporality" json:"aggregation_temporality,omitempty"` + TypeStrindex int32 `protobuf:"varint,1,opt,name=type_strindex,json=typeStrindex,proto3" json:"type_strindex,omitempty"` + UnitStrindex int32 `protobuf:"varint,2,opt,name=unit_strindex,json=unitStrindex,proto3" json:"unit_strindex,omitempty"` + AggregationTemporality AggregationTemporality `protobuf:"varint,3,opt,name=aggregation_temporality,json=aggregationTemporality,proto3,enum=opentelemetry.proto.profiles.v1development.AggregationTemporality" json:"aggregation_temporality,omitempty"` } func (m *ValueType) Reset() { *m = ValueType{} } func (m *ValueType) String() string { return proto.CompactTextString(m) } func (*ValueType) ProtoMessage() {} func (*ValueType) Descriptor() ([]byte, []int) { - return fileDescriptor_05f9ce3fdbeb046f, []int{3} + return fileDescriptor_ddd0cf081a2fe76f, []int{6} } func (m *ValueType) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -501,16 +714,16 @@ func (m *ValueType) XXX_DiscardUnknown() { var xxx_messageInfo_ValueType proto.InternalMessageInfo -func (m *ValueType) GetType() int64 { +func (m *ValueType) GetTypeStrindex() int32 { if m != nil { - return m.Type + return m.TypeStrindex } return 0 } -func (m *ValueType) GetUnit() int64 { +func (m *ValueType) GetUnitStrindex() int32 { if m != nil { - return m.Unit + return m.UnitStrindex } return 0 } @@ -527,48 +740,35 @@ func (m *ValueType) GetAggregationTemporality() AggregationTemporality { // augmented with auxiliary information like the thread-id, some // indicator of a higher level request being handled etc. type Sample struct { - // The indices recorded here correspond to locations in Profile.location. - // The leaf is at location_index[0]. [deprecated, superseded by locations_start_index / locations_length] - LocationIndex []uint64 `protobuf:"varint,1,rep,packed,name=location_index,json=locationIndex,proto3" json:"location_index,omitempty"` - // locations_start_index along with locations_length refers to to a slice of locations in Profile.location. - // Supersedes location_index. - LocationsStartIndex uint64 `protobuf:"varint,7,opt,name=locations_start_index,json=locationsStartIndex,proto3" json:"locations_start_index,omitempty"` - // locations_length along with locations_start_index refers to a slice of locations in Profile.location. + // locations_start_index along with locations_length refers to to a slice of locations in Profile.location_indices. + LocationsStartIndex int32 `protobuf:"varint,1,opt,name=locations_start_index,json=locationsStartIndex,proto3" json:"locations_start_index,omitempty"` + // locations_length along with locations_start_index refers to a slice of locations in Profile.location_indices. // Supersedes location_index. - LocationsLength uint64 `protobuf:"varint,8,opt,name=locations_length,json=locationsLength,proto3" json:"locations_length,omitempty"` - // A 128bit id that uniquely identifies this stacktrace, globally. Index into string table. [optional] - StacktraceIdIndex uint32 `protobuf:"varint,9,opt,name=stacktrace_id_index,json=stacktraceIdIndex,proto3" json:"stacktrace_id_index,omitempty"` + LocationsLength int32 `protobuf:"varint,2,opt,name=locations_length,json=locationsLength,proto3" json:"locations_length,omitempty"` // The type and unit of each value is defined by the corresponding // entry in Profile.sample_type. All samples must have the same // number of values, the same as the length of Profile.sample_type. // When aggregating multiple samples into a single sample, the // result has a list of values that is the element-wise sum of the // lists of the originals. - Value []int64 `protobuf:"varint,2,rep,packed,name=value,proto3" json:"value,omitempty"` - // label includes additional context for this sample. It can include - // things like a thread id, allocation size, etc. - // - // NOTE: While possible, having multiple values for the same label key is - // strongly discouraged and should never be used. Most tools (e.g. pprof) do - // not have good (or any) support for multi-value labels. And an even more - // discouraged case is having a string label and a numeric label of the same - // name on a sample. Again, possible to express, but should not be used. - // [deprecated, superseded by attributes] - Label []*Label `protobuf:"bytes,3,rep,name=label,proto3" json:"label,omitempty"` + Value []int64 `protobuf:"varint,3,rep,packed,name=value,proto3" json:"value,omitempty"` // References to attributes in Profile.attribute_table. [optional] - Attributes []uint64 `protobuf:"varint,10,rep,packed,name=attributes,proto3" json:"attributes,omitempty"` + AttributeIndices []int32 `protobuf:"varint,4,rep,packed,name=attribute_indices,json=attributeIndices,proto3" json:"attribute_indices,omitempty"` // Reference to link in Profile.link_table. [optional] - Link uint64 `protobuf:"varint,12,opt,name=link,proto3" json:"link,omitempty"` + // + // Types that are valid to be assigned to LinkIndex_: + // *Sample_LinkIndex + LinkIndex_ isSample_LinkIndex_ `protobuf_oneof:"link_index_"` // Timestamps associated with Sample represented in nanoseconds. These timestamps are expected // to fall within the Profile's time range. [optional] - TimestampsUnixNano []uint64 `protobuf:"varint,13,rep,packed,name=timestamps_unix_nano,json=timestampsUnixNano,proto3" json:"timestamps_unix_nano,omitempty"` + TimestampsUnixNano []uint64 `protobuf:"varint,6,rep,packed,name=timestamps_unix_nano,json=timestampsUnixNano,proto3" json:"timestamps_unix_nano,omitempty"` } func (m *Sample) Reset() { *m = Sample{} } func (m *Sample) String() string { return proto.CompactTextString(m) } func (*Sample) ProtoMessage() {} func (*Sample) Descriptor() ([]byte, []int) { - return fileDescriptor_05f9ce3fdbeb046f, []int{4} + return fileDescriptor_ddd0cf081a2fe76f, []int{7} } func (m *Sample) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -597,34 +797,39 @@ func (m *Sample) XXX_DiscardUnknown() { var xxx_messageInfo_Sample proto.InternalMessageInfo -func (m *Sample) GetLocationIndex() []uint64 { +type isSample_LinkIndex_ interface { + isSample_LinkIndex_() + MarshalTo([]byte) (int, error) + Size() int +} + +type Sample_LinkIndex struct { + LinkIndex int32 `protobuf:"varint,5,opt,name=link_index,json=linkIndex,proto3,oneof" json:"link_index,omitempty"` +} + +func (*Sample_LinkIndex) isSample_LinkIndex_() {} + +func (m *Sample) GetLinkIndex_() isSample_LinkIndex_ { if m != nil { - return m.LocationIndex + return m.LinkIndex_ } return nil } -func (m *Sample) GetLocationsStartIndex() uint64 { +func (m *Sample) GetLocationsStartIndex() int32 { if m != nil { return m.LocationsStartIndex } return 0 } -func (m *Sample) GetLocationsLength() uint64 { +func (m *Sample) GetLocationsLength() int32 { if m != nil { return m.LocationsLength } return 0 } -func (m *Sample) GetStacktraceIdIndex() uint32 { - if m != nil { - return m.StacktraceIdIndex - } - return 0 -} - func (m *Sample) GetValue() []int64 { if m != nil { return m.Value @@ -632,23 +837,16 @@ func (m *Sample) GetValue() []int64 { return nil } -func (m *Sample) GetLabel() []*Label { - if m != nil { - return m.Label - } - return nil -} - -func (m *Sample) GetAttributes() []uint64 { +func (m *Sample) GetAttributeIndices() []int32 { if m != nil { - return m.Attributes + return m.AttributeIndices } return nil } -func (m *Sample) GetLink() uint64 { - if m != nil { - return m.Link +func (m *Sample) GetLinkIndex() int32 { + if x, ok := m.GetLinkIndex_().(*Sample_LinkIndex); ok { + return x.LinkIndex } return 0 } @@ -660,13 +858,20 @@ func (m *Sample) GetTimestampsUnixNano() []uint64 { return nil } +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Sample) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Sample_LinkIndex)(nil), + } +} + // Provides additional context for a sample, // such as thread ID or allocation size, with optional units. [deprecated] type Label struct { - Key int64 `protobuf:"varint,1,opt,name=key,proto3" json:"key,omitempty"` + KeyStrindex int32 `protobuf:"varint,1,opt,name=key_strindex,json=keyStrindex,proto3" json:"key_strindex,omitempty"` // At most one of the following must be present - Str int64 `protobuf:"varint,2,opt,name=str,proto3" json:"str,omitempty"` - Num int64 `protobuf:"varint,3,opt,name=num,proto3" json:"num,omitempty"` + StrStrindex int32 `protobuf:"varint,2,opt,name=str_strindex,json=strStrindex,proto3" json:"str_strindex,omitempty"` + Num int64 `protobuf:"varint,3,opt,name=num,proto3" json:"num,omitempty"` // Should only be present when num is present. // Specifies the units of num. // Use arbitrary string (for example, "requests") as a custom count unit. @@ -674,14 +879,14 @@ type Label struct { // Consumers may also interpret units like "bytes" and "kilobytes" as memory // units and units like "seconds" and "nanoseconds" as time units, // and apply appropriate unit conversions to these. - NumUnit int64 `protobuf:"varint,4,opt,name=num_unit,json=numUnit,proto3" json:"num_unit,omitempty"` + NumUnitStrindex int32 `protobuf:"varint,4,opt,name=num_unit_strindex,json=numUnitStrindex,proto3" json:"num_unit_strindex,omitempty"` } func (m *Label) Reset() { *m = Label{} } func (m *Label) String() string { return proto.CompactTextString(m) } func (*Label) ProtoMessage() {} func (*Label) Descriptor() ([]byte, []int) { - return fileDescriptor_05f9ce3fdbeb046f, []int{5} + return fileDescriptor_ddd0cf081a2fe76f, []int{8} } func (m *Label) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -710,16 +915,16 @@ func (m *Label) XXX_DiscardUnknown() { var xxx_messageInfo_Label proto.InternalMessageInfo -func (m *Label) GetKey() int64 { +func (m *Label) GetKeyStrindex() int32 { if m != nil { - return m.Key + return m.KeyStrindex } return 0 } -func (m *Label) GetStr() int64 { +func (m *Label) GetStrStrindex() int32 { if m != nil { - return m.Str + return m.StrStrindex } return 0 } @@ -731,9 +936,9 @@ func (m *Label) GetNum() int64 { return 0 } -func (m *Label) GetNumUnit() int64 { +func (m *Label) GetNumUnitStrindex() int32 { if m != nil { - return m.NumUnit + return m.NumUnitStrindex } return 0 } @@ -741,38 +946,30 @@ func (m *Label) GetNumUnit() int64 { // Describes the mapping of a binary in memory, including its address range, // file offset, and metadata like build ID type Mapping struct { - // Unique nonzero id for the mapping. [deprecated] - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // Address at which the binary (or DLL) is loaded into memory. - MemoryStart uint64 `protobuf:"varint,2,opt,name=memory_start,json=memoryStart,proto3" json:"memory_start,omitempty"` + MemoryStart uint64 `protobuf:"varint,1,opt,name=memory_start,json=memoryStart,proto3" json:"memory_start,omitempty"` // The limit of the address range occupied by this mapping. - MemoryLimit uint64 `protobuf:"varint,3,opt,name=memory_limit,json=memoryLimit,proto3" json:"memory_limit,omitempty"` + MemoryLimit uint64 `protobuf:"varint,2,opt,name=memory_limit,json=memoryLimit,proto3" json:"memory_limit,omitempty"` // Offset in the binary that corresponds to the first mapped address. - FileOffset uint64 `protobuf:"varint,4,opt,name=file_offset,json=fileOffset,proto3" json:"file_offset,omitempty"` + FileOffset uint64 `protobuf:"varint,3,opt,name=file_offset,json=fileOffset,proto3" json:"file_offset,omitempty"` // The object this entry is loaded from. This can be a filename on // disk for the main binary and shared libraries, or virtual // abstractions like "[vdso]". - Filename int64 `protobuf:"varint,5,opt,name=filename,proto3" json:"filename,omitempty"` - // A string that uniquely identifies a particular program version - // with high probability. E.g., for binaries generated by GNU tools, - // it could be the contents of the .note.gnu.build-id field. - BuildId int64 `protobuf:"varint,6,opt,name=build_id,json=buildId,proto3" json:"build_id,omitempty"` - // Specifies the kind of build id. See BuildIdKind enum for more details [optional] - BuildIdKind BuildIdKind `protobuf:"varint,11,opt,name=build_id_kind,json=buildIdKind,proto3,enum=opentelemetry.proto.profiles.v1experimental.BuildIdKind" json:"build_id_kind,omitempty"` + FilenameStrindex int32 `protobuf:"varint,4,opt,name=filename_strindex,json=filenameStrindex,proto3" json:"filename_strindex,omitempty"` // References to attributes in Profile.attribute_table. [optional] - Attributes []uint64 `protobuf:"varint,12,rep,packed,name=attributes,proto3" json:"attributes,omitempty"` + AttributeIndices []int32 `protobuf:"varint,5,rep,packed,name=attribute_indices,json=attributeIndices,proto3" json:"attribute_indices,omitempty"` // The following fields indicate the resolution of symbolic info. - HasFunctions bool `protobuf:"varint,7,opt,name=has_functions,json=hasFunctions,proto3" json:"has_functions,omitempty"` - HasFilenames bool `protobuf:"varint,8,opt,name=has_filenames,json=hasFilenames,proto3" json:"has_filenames,omitempty"` - HasLineNumbers bool `protobuf:"varint,9,opt,name=has_line_numbers,json=hasLineNumbers,proto3" json:"has_line_numbers,omitempty"` - HasInlineFrames bool `protobuf:"varint,10,opt,name=has_inline_frames,json=hasInlineFrames,proto3" json:"has_inline_frames,omitempty"` + HasFunctions bool `protobuf:"varint,6,opt,name=has_functions,json=hasFunctions,proto3" json:"has_functions,omitempty"` + HasFilenames bool `protobuf:"varint,7,opt,name=has_filenames,json=hasFilenames,proto3" json:"has_filenames,omitempty"` + HasLineNumbers bool `protobuf:"varint,8,opt,name=has_line_numbers,json=hasLineNumbers,proto3" json:"has_line_numbers,omitempty"` + HasInlineFrames bool `protobuf:"varint,9,opt,name=has_inline_frames,json=hasInlineFrames,proto3" json:"has_inline_frames,omitempty"` } func (m *Mapping) Reset() { *m = Mapping{} } func (m *Mapping) String() string { return proto.CompactTextString(m) } func (*Mapping) ProtoMessage() {} func (*Mapping) Descriptor() ([]byte, []int) { - return fileDescriptor_05f9ce3fdbeb046f, []int{6} + return fileDescriptor_ddd0cf081a2fe76f, []int{9} } func (m *Mapping) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -801,13 +998,6 @@ func (m *Mapping) XXX_DiscardUnknown() { var xxx_messageInfo_Mapping proto.InternalMessageInfo -func (m *Mapping) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - func (m *Mapping) GetMemoryStart() uint64 { if m != nil { return m.MemoryStart @@ -829,30 +1019,16 @@ func (m *Mapping) GetFileOffset() uint64 { return 0 } -func (m *Mapping) GetFilename() int64 { - if m != nil { - return m.Filename - } - return 0 -} - -func (m *Mapping) GetBuildId() int64 { +func (m *Mapping) GetFilenameStrindex() int32 { if m != nil { - return m.BuildId + return m.FilenameStrindex } return 0 } -func (m *Mapping) GetBuildIdKind() BuildIdKind { +func (m *Mapping) GetAttributeIndices() []int32 { if m != nil { - return m.BuildIdKind - } - return BuildIdKind_BUILD_ID_LINKER -} - -func (m *Mapping) GetAttributes() []uint64 { - if m != nil { - return m.Attributes + return m.AttributeIndices } return nil } @@ -887,19 +1063,19 @@ func (m *Mapping) GetHasInlineFrames() bool { // Describes function and line table debug information. type Location struct { - // Unique nonzero id for the location. A profile could use - // instruction addresses or any integer sequence as ids. [deprecated] - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // The index of the corresponding profile.Mapping for this location. + // Reference to mapping in Profile.mapping_table. // It can be unset if the mapping is unknown or not applicable for // this profile type. - MappingIndex uint64 `protobuf:"varint,2,opt,name=mapping_index,json=mappingIndex,proto3" json:"mapping_index,omitempty"` + // + // Types that are valid to be assigned to MappingIndex_: + // *Location_MappingIndex + MappingIndex_ isLocation_MappingIndex_ `protobuf_oneof:"mapping_index_"` // The instruction address for this location, if available. It // should be within [Mapping.memory_start...Mapping.memory_limit] // for the corresponding mapping. A non-leaf address may be in the // middle of a call instruction. It is up to display tools to find // the beginning of the instruction if necessary. - Address uint64 `protobuf:"varint,3,opt,name=address,proto3" json:"address,omitempty"` + Address uint64 `protobuf:"varint,2,opt,name=address,proto3" json:"address,omitempty"` // Multiple line indicates this location has inlined functions, // where the last entry represents the caller into which the // preceding entries were inlined. @@ -907,24 +1083,22 @@ type Location struct { // E.g., if memcpy() is inlined into printf: // line[0].function_name == "memcpy" // line[1].function_name == "printf" - Line []*Line `protobuf:"bytes,4,rep,name=line,proto3" json:"line,omitempty"` + Line []*Line `protobuf:"bytes,3,rep,name=line,proto3" json:"line,omitempty"` // Provides an indication that multiple symbols map to this location's // address, for example due to identical code folding by the linker. In that // case the line information above represents one of the multiple // symbols. This field must be recomputed when the symbolization state of the // profile changes. - IsFolded bool `protobuf:"varint,5,opt,name=is_folded,json=isFolded,proto3" json:"is_folded,omitempty"` - // Type of frame (e.g. kernel, native, python, hotspot, php). Index into string table. - TypeIndex uint32 `protobuf:"varint,6,opt,name=type_index,json=typeIndex,proto3" json:"type_index,omitempty"` + IsFolded bool `protobuf:"varint,4,opt,name=is_folded,json=isFolded,proto3" json:"is_folded,omitempty"` // References to attributes in Profile.attribute_table. [optional] - Attributes []uint64 `protobuf:"varint,7,rep,packed,name=attributes,proto3" json:"attributes,omitempty"` + AttributeIndices []int32 `protobuf:"varint,5,rep,packed,name=attribute_indices,json=attributeIndices,proto3" json:"attribute_indices,omitempty"` } func (m *Location) Reset() { *m = Location{} } func (m *Location) String() string { return proto.CompactTextString(m) } func (*Location) ProtoMessage() {} func (*Location) Descriptor() ([]byte, []int) { - return fileDescriptor_05f9ce3fdbeb046f, []int{7} + return fileDescriptor_ddd0cf081a2fe76f, []int{10} } func (m *Location) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -953,16 +1127,28 @@ func (m *Location) XXX_DiscardUnknown() { var xxx_messageInfo_Location proto.InternalMessageInfo -func (m *Location) GetId() uint64 { +type isLocation_MappingIndex_ interface { + isLocation_MappingIndex_() + MarshalTo([]byte) (int, error) + Size() int +} + +type Location_MappingIndex struct { + MappingIndex int32 `protobuf:"varint,1,opt,name=mapping_index,json=mappingIndex,proto3,oneof" json:"mapping_index,omitempty"` +} + +func (*Location_MappingIndex) isLocation_MappingIndex_() {} + +func (m *Location) GetMappingIndex_() isLocation_MappingIndex_ { if m != nil { - return m.Id + return m.MappingIndex_ } - return 0 + return nil } -func (m *Location) GetMappingIndex() uint64 { - if m != nil { - return m.MappingIndex +func (m *Location) GetMappingIndex() int32 { + if x, ok := m.GetMappingIndex_().(*Location_MappingIndex); ok { + return x.MappingIndex } return 0 } @@ -988,24 +1174,24 @@ func (m *Location) GetIsFolded() bool { return false } -func (m *Location) GetTypeIndex() uint32 { +func (m *Location) GetAttributeIndices() []int32 { if m != nil { - return m.TypeIndex + return m.AttributeIndices } - return 0 + return nil } -func (m *Location) GetAttributes() []uint64 { - if m != nil { - return m.Attributes +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Location) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Location_MappingIndex)(nil), } - return nil } // Details a specific line in a source code, linked to a function. type Line struct { - // The index of the corresponding profile.Function for this line. - FunctionIndex uint64 `protobuf:"varint,1,opt,name=function_index,json=functionIndex,proto3" json:"function_index,omitempty"` + // Reference to function in Profile.function_table. + FunctionIndex int32 `protobuf:"varint,1,opt,name=function_index,json=functionIndex,proto3" json:"function_index,omitempty"` // Line number in source code. Line int64 `protobuf:"varint,2,opt,name=line,proto3" json:"line,omitempty"` // Column number in source code. @@ -1016,7 +1202,7 @@ func (m *Line) Reset() { *m = Line{} } func (m *Line) String() string { return proto.CompactTextString(m) } func (*Line) ProtoMessage() {} func (*Line) Descriptor() ([]byte, []int) { - return fileDescriptor_05f9ce3fdbeb046f, []int{8} + return fileDescriptor_ddd0cf081a2fe76f, []int{11} } func (m *Line) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1045,7 +1231,7 @@ func (m *Line) XXX_DiscardUnknown() { var xxx_messageInfo_Line proto.InternalMessageInfo -func (m *Line) GetFunctionIndex() uint64 { +func (m *Line) GetFunctionIndex() int32 { if m != nil { return m.FunctionIndex } @@ -1069,24 +1255,22 @@ func (m *Line) GetColumn() int64 { // Describes a function, including its human-readable name, system name, // source file, and starting line number in the source. type Function struct { - // Unique nonzero id for the function. [deprecated] - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // Name of the function, in human-readable form if available. - Name int64 `protobuf:"varint,2,opt,name=name,proto3" json:"name,omitempty"` + NameStrindex int32 `protobuf:"varint,1,opt,name=name_strindex,json=nameStrindex,proto3" json:"name_strindex,omitempty"` // Name of the function, as identified by the system. // For instance, it can be a C++ mangled name. - SystemName int64 `protobuf:"varint,3,opt,name=system_name,json=systemName,proto3" json:"system_name,omitempty"` + SystemNameStrindex int32 `protobuf:"varint,2,opt,name=system_name_strindex,json=systemNameStrindex,proto3" json:"system_name_strindex,omitempty"` // Source file containing the function. - Filename int64 `protobuf:"varint,4,opt,name=filename,proto3" json:"filename,omitempty"` + FilenameStrindex int32 `protobuf:"varint,3,opt,name=filename_strindex,json=filenameStrindex,proto3" json:"filename_strindex,omitempty"` // Line number in source file. - StartLine int64 `protobuf:"varint,5,opt,name=start_line,json=startLine,proto3" json:"start_line,omitempty"` + StartLine int64 `protobuf:"varint,4,opt,name=start_line,json=startLine,proto3" json:"start_line,omitempty"` } func (m *Function) Reset() { *m = Function{} } func (m *Function) String() string { return proto.CompactTextString(m) } func (*Function) ProtoMessage() {} func (*Function) Descriptor() ([]byte, []int) { - return fileDescriptor_05f9ce3fdbeb046f, []int{9} + return fileDescriptor_ddd0cf081a2fe76f, []int{12} } func (m *Function) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1115,30 +1299,23 @@ func (m *Function) XXX_DiscardUnknown() { var xxx_messageInfo_Function proto.InternalMessageInfo -func (m *Function) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Function) GetName() int64 { +func (m *Function) GetNameStrindex() int32 { if m != nil { - return m.Name + return m.NameStrindex } return 0 } -func (m *Function) GetSystemName() int64 { +func (m *Function) GetSystemNameStrindex() int32 { if m != nil { - return m.SystemName + return m.SystemNameStrindex } return 0 } -func (m *Function) GetFilename() int64 { +func (m *Function) GetFilenameStrindex() int32 { if m != nil { - return m.Filename + return m.FilenameStrindex } return 0 } @@ -1151,122 +1328,134 @@ func (m *Function) GetStartLine() int64 { } func init() { - proto.RegisterEnum("opentelemetry.proto.profiles.v1experimental.AggregationTemporality", AggregationTemporality_name, AggregationTemporality_value) - proto.RegisterEnum("opentelemetry.proto.profiles.v1experimental.BuildIdKind", BuildIdKind_name, BuildIdKind_value) - proto.RegisterType((*Profile)(nil), "opentelemetry.proto.profiles.v1experimental.Profile") - proto.RegisterType((*AttributeUnit)(nil), "opentelemetry.proto.profiles.v1experimental.AttributeUnit") - proto.RegisterType((*Link)(nil), "opentelemetry.proto.profiles.v1experimental.Link") - proto.RegisterType((*ValueType)(nil), "opentelemetry.proto.profiles.v1experimental.ValueType") - proto.RegisterType((*Sample)(nil), "opentelemetry.proto.profiles.v1experimental.Sample") - proto.RegisterType((*Label)(nil), "opentelemetry.proto.profiles.v1experimental.Label") - proto.RegisterType((*Mapping)(nil), "opentelemetry.proto.profiles.v1experimental.Mapping") - proto.RegisterType((*Location)(nil), "opentelemetry.proto.profiles.v1experimental.Location") - proto.RegisterType((*Line)(nil), "opentelemetry.proto.profiles.v1experimental.Line") - proto.RegisterType((*Function)(nil), "opentelemetry.proto.profiles.v1experimental.Function") + proto.RegisterEnum("opentelemetry.proto.profiles.v1development.AggregationTemporality", AggregationTemporality_name, AggregationTemporality_value) + proto.RegisterType((*ProfilesData)(nil), "opentelemetry.proto.profiles.v1development.ProfilesData") + proto.RegisterType((*ResourceProfiles)(nil), "opentelemetry.proto.profiles.v1development.ResourceProfiles") + proto.RegisterType((*ScopeProfiles)(nil), "opentelemetry.proto.profiles.v1development.ScopeProfiles") + proto.RegisterType((*Profile)(nil), "opentelemetry.proto.profiles.v1development.Profile") + proto.RegisterType((*AttributeUnit)(nil), "opentelemetry.proto.profiles.v1development.AttributeUnit") + proto.RegisterType((*Link)(nil), "opentelemetry.proto.profiles.v1development.Link") + proto.RegisterType((*ValueType)(nil), "opentelemetry.proto.profiles.v1development.ValueType") + proto.RegisterType((*Sample)(nil), "opentelemetry.proto.profiles.v1development.Sample") + proto.RegisterType((*Label)(nil), "opentelemetry.proto.profiles.v1development.Label") + proto.RegisterType((*Mapping)(nil), "opentelemetry.proto.profiles.v1development.Mapping") + proto.RegisterType((*Location)(nil), "opentelemetry.proto.profiles.v1development.Location") + proto.RegisterType((*Line)(nil), "opentelemetry.proto.profiles.v1development.Line") + proto.RegisterType((*Function)(nil), "opentelemetry.proto.profiles.v1development.Function") } func init() { - proto.RegisterFile("opentelemetry/proto/profiles/v1experimental/pprofextended.proto", fileDescriptor_05f9ce3fdbeb046f) -} - -var fileDescriptor_05f9ce3fdbeb046f = []byte{ - // 1480 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4f, 0x4f, 0x23, 0x47, - 0x16, 0xa7, 0xb1, 0xf1, 0x9f, 0x67, 0x0c, 0xa6, 0x86, 0x65, 0x7b, 0x67, 0x35, 0xc0, 0x18, 0xed, - 0x0e, 0xcb, 0x48, 0x66, 0x61, 0x76, 0xa3, 0x49, 0x14, 0x29, 0x31, 0x83, 0x19, 0x5a, 0x78, 0x0c, - 0x29, 0x0c, 0x09, 0xd1, 0x44, 0xad, 0xc6, 0x5d, 0x98, 0x16, 0xdd, 0xd5, 0xad, 0xee, 0x32, 0xc2, - 0x52, 0x8e, 0x39, 0x45, 0x39, 0xe4, 0x9c, 0x8f, 0x90, 0x5b, 0x3e, 0x41, 0xae, 0x23, 0xe5, 0x32, - 0x97, 0x48, 0x51, 0x0e, 0xa3, 0x68, 0xe6, 0x6b, 0xe4, 0x10, 0xd5, 0xab, 0x6a, 0xdb, 0x30, 0xcc, - 0xc1, 0x73, 0x41, 0xf5, 0x7e, 0xf5, 0xea, 0x57, 0xaf, 0xfa, 0xbd, 0xdf, 0x7b, 0x06, 0x3e, 0x09, - 0x23, 0xc6, 0x05, 0xf3, 0x59, 0xc0, 0x44, 0xdc, 0x5f, 0x8f, 0xe2, 0x50, 0x84, 0xf2, 0xef, 0x99, - 0xe7, 0xb3, 0x64, 0xfd, 0x72, 0x83, 0x5d, 0x45, 0x2c, 0xf6, 0x02, 0xc6, 0x85, 0xe3, 0xaf, 0x47, - 0x72, 0x83, 0x5d, 0x09, 0xc6, 0x5d, 0xe6, 0xd6, 0xd0, 0x97, 0x3c, 0xbc, 0x46, 0xa0, 0xc0, 0x5a, - 0x4a, 0x50, 0xbb, 0x4e, 0x70, 0x77, 0xbe, 0x1b, 0x76, 0x43, 0x75, 0x87, 0x5c, 0x29, 0xef, 0xbb, - 0x6b, 0xb7, 0xc5, 0xd0, 0x09, 0x83, 0x20, 0xe4, 0xeb, 0x97, 0x1b, 0x7a, 0xa5, 0x7c, 0xab, 0xbf, - 0x14, 0x20, 0x7f, 0xa0, 0xd8, 0xc9, 0xe7, 0x50, 0x4a, 0x9c, 0x20, 0xf2, 0x99, 0x2d, 0xfa, 0x11, - 0x33, 0x8d, 0xe5, 0xcc, 0x6a, 0x69, 0xf3, 0x83, 0xda, 0x18, 0x01, 0xd5, 0x8e, 0x1d, 0xbf, 0xc7, - 0xda, 0xfd, 0x88, 0x51, 0x50, 0x54, 0x72, 0x4d, 0xf6, 0x20, 0xa7, 0x2c, 0x73, 0x12, 0x39, 0x1f, - 0x8d, 0xc5, 0x79, 0x88, 0x47, 0xa9, 0xa6, 0x20, 0x2d, 0xc8, 0x07, 0x4e, 0x14, 0x79, 0xbc, 0x6b, - 0x66, 0x90, 0xed, 0x7f, 0x63, 0xb1, 0x3d, 0x53, 0x67, 0x69, 0x4a, 0x42, 0x3e, 0x83, 0x82, 0x1f, - 0x76, 0x1c, 0xe1, 0x85, 0xdc, 0xcc, 0x22, 0xe1, 0xff, 0xc7, 0x22, 0x6c, 0xea, 0xc3, 0x74, 0x40, - 0x43, 0xfe, 0x03, 0x95, 0x74, 0x6d, 0x7b, 0xdc, 0xf5, 0x3a, 0x2c, 0x31, 0x67, 0x97, 0x33, 0xab, - 0x19, 0x3a, 0x9b, 0xe2, 0x96, 0x82, 0xe5, 0xed, 0x67, 0x3d, 0xde, 0xc1, 0xdb, 0xa7, 0xde, 0xe3, - 0xf6, 0x1d, 0x7d, 0x98, 0x0e, 0x68, 0xc8, 0x31, 0xcc, 0x3a, 0x42, 0xc4, 0xde, 0x69, 0x4f, 0x30, - 0x5b, 0x38, 0xa7, 0x3e, 0x33, 0x2b, 0xc8, 0xfc, 0xe0, 0x56, 0x66, 0x5d, 0x0e, 0x97, 0x1b, 0xb5, - 0x3d, 0xd6, 0xc7, 0xfc, 0x6d, 0x65, 0x5f, 0xbc, 0x5a, 0x9a, 0xa0, 0x33, 0x03, 0x96, 0xb6, 0x24, - 0x21, 0x9d, 0x51, 0xde, 0x1e, 0xf7, 0x44, 0x62, 0xce, 0x21, 0xef, 0x47, 0x63, 0x45, 0x5c, 0x4f, - 0x39, 0x8e, 0xb8, 0x27, 0x46, 0x2e, 0x91, 0x66, 0x42, 0x0e, 0x00, 0x7c, 0x8f, 0x5f, 0xe8, 0xb8, - 0x09, 0xf2, 0x6f, 0x8c, 0x97, 0x0f, 0x8f, 0x5f, 0xd0, 0xa2, 0x24, 0x51, 0x61, 0xdf, 0x87, 0xe9, - 0x44, 0xc4, 0x1e, 0xef, 0x6a, 0xce, 0xdc, 0x72, 0x66, 0xb5, 0x48, 0x4b, 0x0a, 0x53, 0x2e, 0x4b, - 0x50, 0x72, 0xe3, 0x30, 0xb2, 0xcf, 0x62, 0x27, 0x60, 0x89, 0x99, 0x5f, 0x36, 0x56, 0x33, 0x14, - 0x24, 0xb4, 0x83, 0x88, 0x74, 0xb8, 0x60, 0x6c, 0xe0, 0x50, 0x50, 0x0e, 0x12, 0xd2, 0x0e, 0xf7, - 0x00, 0x84, 0x17, 0x30, 0x9b, 0x3b, 0x3c, 0x4c, 0xcc, 0x22, 0xee, 0x17, 0x25, 0xd2, 0x92, 0x00, - 0xf9, 0x17, 0xcc, 0xb8, 0xbd, 0x58, 0x15, 0x84, 0x72, 0x01, 0x74, 0x29, 0xa7, 0xa8, 0x72, 0xfb, - 0x0a, 0x4a, 0xf2, 0x21, 0xa1, 0xab, 0x04, 0x58, 0x5a, 0x36, 0xde, 0x5f, 0x80, 0x3a, 0x89, 0xa0, - 0x08, 0x51, 0x86, 0x0b, 0x90, 0x53, 0x96, 0x39, 0x8d, 0xb7, 0x6b, 0x8b, 0x98, 0x90, 0x97, 0x45, - 0xc0, 0xb8, 0x30, 0xcb, 0x58, 0xa5, 0xa9, 0x49, 0x6a, 0x70, 0xc7, 0x65, 0x67, 0x4e, 0xcf, 0x17, - 0xf6, 0x68, 0x67, 0x98, 0xc1, 0xe3, 0x73, 0x7a, 0xeb, 0x70, 0x20, 0xf4, 0xea, 0x2e, 0x94, 0xaf, - 0xa5, 0x97, 0xac, 0x40, 0x79, 0x58, 0x33, 0x17, 0xac, 0x6f, 0x1a, 0x78, 0x74, 0x7a, 0x00, 0xee, - 0xb1, 0x3e, 0x21, 0x90, 0x95, 0xe5, 0x64, 0x4e, 0xe2, 0x1e, 0xae, 0xab, 0x3f, 0x1b, 0x90, 0x95, - 0x99, 0x24, 0xcf, 0xa1, 0x20, 0x62, 0xa7, 0xc3, 0x6c, 0xcf, 0xc5, 0xc3, 0xd3, 0x5b, 0x75, 0xf9, - 0xb0, 0xdf, 0x5f, 0x2d, 0x7d, 0xd8, 0x0d, 0x6f, 0x7c, 0x1a, 0x4f, 0xb6, 0x39, 0xdf, 0x67, 0x1d, - 0x11, 0xc6, 0xeb, 0x91, 0xeb, 0x08, 0x67, 0xdd, 0xe3, 0x82, 0xc5, 0xdc, 0xf1, 0xd7, 0xa5, 0x55, - 0x6b, 0x4b, 0x26, 0x6b, 0x9b, 0xe6, 0x91, 0xd2, 0x72, 0xc9, 0x09, 0xe4, 0x93, 0xc8, 0xe1, 0x92, - 0x7c, 0x12, 0xc9, 0x3f, 0xd5, 0xe4, 0x8f, 0xc7, 0x27, 0x3f, 0x8c, 0x1c, 0x6e, 0x6d, 0xd3, 0x9c, - 0x24, 0xb4, 0xdc, 0xea, 0x4f, 0x06, 0x14, 0x07, 0xd9, 0x90, 0x6f, 0xd4, 0x4d, 0x15, 0xdf, 0x28, - 0x34, 0x76, 0xf3, 0xdd, 0xe4, 0x6b, 0xf8, 0xbb, 0xd3, 0xed, 0xc6, 0xac, 0xab, 0x8a, 0x45, 0xb0, - 0x20, 0x0a, 0x63, 0xc7, 0xf7, 0x44, 0xdf, 0xcc, 0x2c, 0x1b, 0xab, 0x33, 0x9b, 0x4f, 0xc6, 0x13, - 0xdb, 0x90, 0xab, 0x3d, 0xa4, 0xa2, 0x0b, 0xce, 0xad, 0x78, 0xf5, 0x9b, 0x0c, 0xe4, 0x54, 0x3a, - 0x65, 0xc9, 0x8e, 0xf6, 0x30, 0x76, 0x85, 0xf3, 0x20, 0x4b, 0xcb, 0x23, 0x1d, 0x8c, 0x5d, 0x91, - 0x4d, 0xf8, 0x5b, 0x0a, 0x24, 0x76, 0x22, 0x9c, 0x58, 0x68, 0x6f, 0x29, 0xa2, 0x2c, 0xbd, 0x33, - 0xd8, 0x3c, 0x94, 0x7b, 0xea, 0xcc, 0x48, 0x7b, 0x4c, 0x6c, 0x9f, 0xf1, 0xae, 0x38, 0x47, 0x49, - 0x65, 0x87, 0xed, 0x31, 0x69, 0x22, 0x2c, 0x0b, 0x30, 0x11, 0x4e, 0xe7, 0x22, 0x2d, 0x01, 0x4d, - 0x2e, 0x05, 0x56, 0xa6, 0x73, 0xc3, 0x2d, 0xcb, 0x55, 0xd4, 0xf3, 0x30, 0x75, 0x29, 0xbf, 0x39, - 0x0e, 0x9a, 0x0c, 0x55, 0x06, 0xd9, 0x85, 0x29, 0xdf, 0x39, 0x65, 0xbe, 0x1e, 0x18, 0x9b, 0xe3, - 0xf5, 0x13, 0x79, 0x92, 0x2a, 0x02, 0xb2, 0x08, 0x30, 0x28, 0x5d, 0x29, 0x62, 0xf9, 0x45, 0x46, - 0x10, 0x99, 0x52, 0xd9, 0x79, 0x50, 0x60, 0x59, 0x8a, 0x6b, 0xf2, 0x5f, 0x98, 0x97, 0x9d, 0x20, - 0x11, 0x4e, 0x10, 0x25, 0xb2, 0x71, 0x5e, 0x61, 0x0f, 0x40, 0xad, 0x65, 0x29, 0x19, 0xee, 0x1d, - 0x71, 0xef, 0x4a, 0x36, 0x82, 0xea, 0x17, 0x30, 0x85, 0xb7, 0x92, 0x0a, 0x64, 0x86, 0xa2, 0x91, - 0x4b, 0x89, 0x24, 0x22, 0xd6, 0x25, 0x23, 0x97, 0x12, 0xe1, 0xbd, 0x00, 0xab, 0x23, 0x43, 0xe5, - 0x92, 0xfc, 0x03, 0x0a, 0xbc, 0x17, 0x60, 0x8b, 0x36, 0xb3, 0x08, 0xe7, 0x79, 0x2f, 0x90, 0x7a, - 0xac, 0xfe, 0x9a, 0x81, 0xbc, 0x9e, 0x80, 0x64, 0x06, 0x26, 0xb5, 0xa6, 0xb2, 0x74, 0xd2, 0x73, - 0x65, 0xa3, 0x0c, 0x58, 0x10, 0xc6, 0x7d, 0x95, 0x47, 0xbc, 0x23, 0x4b, 0x4b, 0x0a, 0xc3, 0xf4, - 0x8d, 0xb8, 0xf8, 0x5e, 0xe0, 0x09, 0xbc, 0x74, 0xe0, 0xd2, 0x94, 0x90, 0x6c, 0x95, 0xf2, 0x33, - 0xda, 0xe1, 0xd9, 0x59, 0xc2, 0xd4, 0xfd, 0x59, 0x0a, 0x12, 0xda, 0x47, 0x84, 0xdc, 0x85, 0x82, - 0xb4, 0xb8, 0x13, 0x30, 0x73, 0x0a, 0xa3, 0x1b, 0xd8, 0x32, 0xf2, 0xd3, 0x9e, 0xe7, 0xbb, 0x52, - 0x8f, 0x39, 0x15, 0x39, 0xda, 0x96, 0x4b, 0x9e, 0x43, 0x39, 0xdd, 0xb2, 0x2f, 0x3c, 0xee, 0x62, - 0x77, 0x9c, 0xd9, 0x7c, 0x3c, 0x56, 0x2e, 0xb7, 0x14, 0xd9, 0x9e, 0xc7, 0x5d, 0x5a, 0x3a, 0x1d, - 0x1a, 0x37, 0xf2, 0x3a, 0xfd, 0x56, 0x5e, 0x57, 0xa0, 0x7c, 0xee, 0x24, 0x76, 0x3a, 0x63, 0xd5, - 0x8c, 0x28, 0xd0, 0xe9, 0x73, 0x27, 0x49, 0x27, 0xf0, 0xd0, 0x49, 0xbf, 0x46, 0xcd, 0x09, 0xed, - 0x94, 0x62, 0x64, 0x15, 0x2a, 0xd2, 0xc9, 0xf7, 0x38, 0xb3, 0x79, 0x2f, 0x38, 0x65, 0xb1, 0x9a, - 0x17, 0x05, 0x3a, 0x73, 0xee, 0x24, 0x4d, 0x8f, 0xb3, 0x96, 0x42, 0xc9, 0x1a, 0xcc, 0x49, 0x4f, - 0x8f, 0xa3, 0xaf, 0x1e, 0x3d, 0x80, 0xae, 0xb3, 0xe7, 0x4e, 0x62, 0x21, 0xae, 0xe6, 0x4f, 0xf5, - 0x4f, 0x03, 0x0a, 0xe9, 0x0f, 0x91, 0xb7, 0x12, 0xbb, 0x02, 0x65, 0xfd, 0x63, 0x47, 0xcb, 0x47, - 0x65, 0x76, 0x5a, 0x83, 0x4a, 0x39, 0x26, 0xe4, 0x1d, 0xd7, 0x8d, 0x59, 0x92, 0xe8, 0xac, 0xa6, - 0x26, 0x69, 0x60, 0x4d, 0x33, 0xfd, 0xe3, 0x68, 0xec, 0x61, 0xcc, 0x50, 0x06, 0x8c, 0xfc, 0x13, - 0x8a, 0x5e, 0x62, 0x9f, 0x85, 0xbe, 0xcb, 0x5c, 0x4c, 0x7c, 0x81, 0x16, 0xbc, 0x64, 0x07, 0x6d, - 0x9c, 0x9f, 0xfd, 0x88, 0xe9, 0xf8, 0x72, 0x28, 0xef, 0xa2, 0x44, 0x54, 0x70, 0xd7, 0xd3, 0x93, - 0xbf, 0x99, 0x9e, 0xea, 0x09, 0x0e, 0x0b, 0x6c, 0x5a, 0x69, 0x8a, 0x06, 0x4d, 0x4b, 0xbe, 0xa5, - 0x9c, 0xa2, 0x8a, 0x8e, 0xe8, 0x17, 0xe9, 0xc6, 0x8b, 0xe1, 0x2d, 0x40, 0xae, 0x13, 0xfa, 0xbd, - 0x80, 0x6b, 0x25, 0x69, 0xab, 0xfa, 0xad, 0x01, 0x85, 0x34, 0xc5, 0x6f, 0x7d, 0x59, 0x02, 0x59, - 0xac, 0x63, 0x4d, 0x84, 0x35, 0xbc, 0x04, 0xa5, 0xa4, 0x9f, 0x08, 0x16, 0xd8, 0xb8, 0xa5, 0xd8, - 0x40, 0x41, 0x2d, 0xe9, 0x30, 0x2a, 0x80, 0xec, 0x0d, 0x01, 0xdc, 0x03, 0x50, 0x4d, 0x14, 0xe3, - 0x53, 0xf2, 0x28, 0x22, 0x22, 0xdf, 0xb7, 0xf6, 0x9d, 0x01, 0x0b, 0xb7, 0xb7, 0x74, 0xf2, 0x00, - 0x56, 0xea, 0x4f, 0x9f, 0xd2, 0xc6, 0xd3, 0x7a, 0xdb, 0xda, 0x6f, 0xd9, 0xed, 0xc6, 0xb3, 0x83, - 0x7d, 0x5a, 0x6f, 0x5a, 0xed, 0x13, 0xfb, 0xa8, 0x75, 0x78, 0xd0, 0x78, 0x62, 0xed, 0x58, 0x8d, - 0xed, 0xca, 0x04, 0xb9, 0x0f, 0xf7, 0xde, 0xe5, 0xb8, 0xdd, 0x68, 0xb6, 0xeb, 0x15, 0x83, 0xfc, - 0x1b, 0xaa, 0xef, 0x72, 0x79, 0x72, 0xf4, 0xec, 0xa8, 0x59, 0x6f, 0x5b, 0xc7, 0x8d, 0xca, 0xe4, - 0xda, 0xc7, 0x50, 0x1a, 0x51, 0x14, 0xb9, 0x03, 0xb3, 0x5b, 0x47, 0x56, 0x73, 0xdb, 0xb6, 0xb6, - 0xed, 0xa6, 0xd5, 0xda, 0x6b, 0xd0, 0xca, 0x04, 0x31, 0x61, 0x7e, 0x00, 0x6e, 0x59, 0xad, 0x3a, - 0x3d, 0xb1, 0x77, 0xeb, 0x87, 0xbb, 0x15, 0x63, 0xeb, 0x07, 0xe3, 0xc5, 0xeb, 0x45, 0xe3, 0xe5, - 0xeb, 0x45, 0xe3, 0x8f, 0xd7, 0x8b, 0xc6, 0xf7, 0x6f, 0x16, 0x27, 0x5e, 0xbe, 0x59, 0x9c, 0xf8, - 0xed, 0xcd, 0xe2, 0xc4, 0x97, 0x74, 0xec, 0xe9, 0xab, 0xfe, 0xcb, 0xe9, 0x32, 0xfe, 0xae, 0x7f, - 0xb6, 0x7e, 0x9c, 0x7c, 0xb8, 0x1f, 0x31, 0xde, 0x1e, 0x30, 0x1e, 0x60, 0xe1, 0x1e, 0xa4, 0x85, - 0x7b, 0xbc, 0xd1, 0x18, 0xf1, 0x3e, 0xcd, 0x21, 0xdf, 0xa3, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, - 0x92, 0x79, 0x01, 0x14, 0xd0, 0x0d, 0x00, 0x00, -} - -func (m *Profile) Marshal() (dAtA []byte, err error) { + proto.RegisterFile("opentelemetry/proto/profiles/v1development/profiles.proto", fileDescriptor_ddd0cf081a2fe76f) +} + +var fileDescriptor_ddd0cf081a2fe76f = []byte{ + // 1647 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0x5b, 0x6f, 0x1b, 0xc7, + 0x15, 0xd6, 0xf2, 0xce, 0xc3, 0x8b, 0xa8, 0x89, 0xac, 0x6c, 0xd3, 0x5a, 0x66, 0x68, 0xa4, 0x61, + 0x54, 0x44, 0xb2, 0xe4, 0xb4, 0x88, 0xd1, 0x02, 0xad, 0x64, 0x4a, 0x0e, 0x63, 0xea, 0xd2, 0x15, + 0x25, 0xd4, 0x6d, 0x80, 0xed, 0x88, 0x3b, 0xa4, 0xb6, 0xda, 0x9d, 0x5d, 0xec, 0x0c, 0x05, 0x13, + 0xfd, 0x09, 0xcd, 0x43, 0x1f, 0xfb, 0x1b, 0x0a, 0xf4, 0x37, 0xf4, 0x35, 0x8f, 0x46, 0x9f, 0x82, + 0x3e, 0x04, 0x85, 0xfd, 0x92, 0x16, 0xe8, 0x7f, 0x28, 0xe6, 0xb2, 0xcb, 0x4b, 0x29, 0x24, 0xeb, + 0x17, 0x61, 0xe7, 0x9c, 0x6f, 0xbe, 0x39, 0x67, 0xce, 0x65, 0x8e, 0x08, 0x4f, 0x82, 0x90, 0x50, + 0x4e, 0x3c, 0xe2, 0x13, 0x1e, 0x4d, 0x76, 0xc2, 0x28, 0xe0, 0x81, 0xf8, 0x3b, 0x74, 0x3d, 0xc2, + 0x76, 0x6e, 0x77, 0x1d, 0x72, 0x4b, 0xbc, 0x20, 0xf4, 0x09, 0xe5, 0x89, 0x78, 0x5b, 0xa2, 0xd0, + 0xd6, 0xdc, 0x56, 0x25, 0xdc, 0x4e, 0x30, 0x73, 0x5b, 0xdf, 0x5b, 0x1f, 0x05, 0xa3, 0x40, 0x91, + 0x8b, 0x2f, 0x05, 0x7e, 0x6f, 0x6b, 0xd9, 0xe1, 0x83, 0xc0, 0xf7, 0x03, 0xba, 0x73, 0xbb, 0xab, + 0xbf, 0x34, 0x76, 0x7b, 0x19, 0x36, 0x22, 0x2c, 0x18, 0x47, 0x03, 0x22, 0xd0, 0xf1, 0xb7, 0xc2, + 0xb7, 0x26, 0x50, 0x3d, 0xd3, 0xb6, 0x74, 0x30, 0xc7, 0xc8, 0x85, 0xb5, 0x18, 0x61, 0xc7, 0x46, + 0x9a, 0x46, 0x33, 0xdb, 0xae, 0xec, 0xfd, 0x62, 0xfb, 0xfb, 0x7b, 0xb2, 0x6d, 0x69, 0x92, 0x98, + 0xdc, 0x6a, 0x44, 0x0b, 0x92, 0xd6, 0xb7, 0x06, 0x34, 0x16, 0x61, 0xe8, 0x39, 0x94, 0x62, 0xa0, + 0x69, 0x34, 0x8d, 0x76, 0x65, 0xef, 0xa3, 0xa5, 0xc7, 0x26, 0x6e, 0xdc, 0xee, 0x26, 0x67, 0x1d, + 0xe4, 0xbe, 0xfa, 0xe6, 0xc1, 0x8a, 0x95, 0x10, 0xa0, 0xdf, 0x43, 0x9d, 0x0d, 0x82, 0x70, 0xc6, + 0x93, 0x8c, 0xf4, 0xe4, 0x49, 0x1a, 0x4f, 0xce, 0x05, 0x43, 0xe2, 0x46, 0x8d, 0xcd, 0x2e, 0xd1, + 0x7d, 0x00, 0x36, 0xb8, 0x26, 0x3e, 0xb6, 0xc7, 0x91, 0x67, 0x66, 0x9b, 0x46, 0xbb, 0x6c, 0x95, + 0x95, 0xe4, 0x22, 0xf2, 0x3e, 0x2f, 0x94, 0xbe, 0x2d, 0x36, 0xfe, 0x5d, 0x6c, 0xbd, 0x32, 0xa0, + 0x36, 0xc7, 0x83, 0x4e, 0x21, 0x2f, 0x99, 0xb4, 0x93, 0x8f, 0x97, 0x5a, 0xa4, 0x23, 0x7b, 0xbb, + 0xbb, 0xdd, 0xa5, 0x8c, 0x47, 0x63, 0x61, 0x0f, 0xe6, 0x6e, 0x40, 0x25, 0x97, 0x76, 0x57, 0xf1, + 0xa0, 0x53, 0x28, 0x2d, 0x78, 0xf9, 0x38, 0x8d, 0x97, 0xda, 0x30, 0x2b, 0x21, 0xf9, 0x0e, 0xd7, + 0x5a, 0x7f, 0xa9, 0x40, 0x51, 0x6f, 0x42, 0x97, 0x50, 0x61, 0xd8, 0x0f, 0x3d, 0x62, 0xf3, 0x89, + 0x74, 0x49, 0x1c, 0xff, 0xd3, 0x34, 0xc7, 0x5f, 0x62, 0x6f, 0x4c, 0xfa, 0x93, 0x90, 0x58, 0xa0, + 0x98, 0xc4, 0x37, 0xfa, 0x1c, 0x0a, 0x6a, 0xa5, 0x3d, 0xda, 0x4b, 0x15, 0x37, 0xb9, 0xd3, 0xd2, + 0x0c, 0xe8, 0x37, 0x50, 0xf3, 0x71, 0x18, 0xba, 0x74, 0x64, 0x73, 0x7c, 0xe5, 0x11, 0x33, 0x9b, + 0xfe, 0x92, 0x8e, 0x15, 0x81, 0x55, 0xd5, 0x4c, 0x7d, 0x41, 0x84, 0x7e, 0x07, 0x75, 0x2f, 0x18, + 0xc8, 0xb8, 0x68, 0xea, 0x9c, 0xa4, 0xfe, 0x24, 0x0d, 0x75, 0x4f, 0x33, 0x58, 0xb5, 0x98, 0x4b, + 0x91, 0x7f, 0x04, 0x8d, 0x84, 0xdc, 0xa5, 0x8e, 0x3b, 0x20, 0xcc, 0xcc, 0x37, 0xb3, 0xed, 0xbc, + 0xb5, 0x1a, 0xcb, 0xbb, 0x4a, 0x2c, 0xec, 0x18, 0x8e, 0xe9, 0x60, 0xc6, 0x8e, 0x42, 0x7a, 0x3b, + 0x8e, 0x34, 0x83, 0x55, 0x8b, 0xb9, 0x94, 0x1d, 0x97, 0xb0, 0x8a, 0x39, 0x8f, 0xdc, 0xab, 0x31, + 0x27, 0x9a, 0xbd, 0x28, 0xd9, 0x3f, 0xfc, 0x8e, 0xcc, 0x7d, 0x4e, 0x26, 0x32, 0xb8, 0x3a, 0x5b, + 0xeb, 0x09, 0x8b, 0xe2, 0xbd, 0x9a, 0xe5, 0x1d, 0x53, 0x97, 0x33, 0xb3, 0x94, 0xbe, 0x46, 0xf7, + 0x63, 0x8a, 0x0b, 0xea, 0xf2, 0x99, 0x33, 0xc4, 0x52, 0xd4, 0x1a, 0x78, 0x2e, 0xbd, 0xd1, 0x66, + 0x97, 0x25, 0xfd, 0xa3, 0x54, 0xc1, 0x71, 0xe9, 0x8d, 0x55, 0x16, 0x1c, 0xca, 0xe8, 0xf7, 0xa1, + 0xca, 0x78, 0x34, 0x4d, 0x25, 0x68, 0x66, 0xdb, 0x65, 0xab, 0xa2, 0x64, 0x0a, 0x72, 0x1f, 0x80, + 0xbb, 0x3e, 0xb1, 0x29, 0xa6, 0x01, 0x33, 0x2b, 0x4d, 0xa3, 0x9d, 0xb5, 0xca, 0x42, 0x72, 0x22, + 0x04, 0xe8, 0x03, 0xa8, 0x3b, 0xe3, 0x48, 0x85, 0x55, 0x41, 0xaa, 0x12, 0x52, 0x8b, 0xa5, 0x0a, + 0xf6, 0x05, 0x54, 0x42, 0x12, 0xb9, 0x81, 0xa3, 0x0a, 0xab, 0x26, 0x7b, 0xc5, 0xdb, 0x15, 0x96, + 0xbe, 0x7f, 0x50, 0x7c, 0xb2, 0xbc, 0x36, 0xa0, 0xa0, 0x56, 0x66, 0x5d, 0x1e, 0xae, 0x57, 0xe8, + 0x63, 0x40, 0x22, 0x7e, 0x84, 0x72, 0x5b, 0xba, 0xa4, 0xb2, 0x6e, 0x55, 0x66, 0xdd, 0x9a, 0xd6, + 0x9c, 0x27, 0x0a, 0xf4, 0x4b, 0xf8, 0x91, 0x43, 0x86, 0x78, 0xec, 0x71, 0x7b, 0xa6, 0x0b, 0xe8, + 0xad, 0xe4, 0xa5, 0xd9, 0x68, 0x1a, 0xed, 0xbc, 0xf5, 0x03, 0x8d, 0x39, 0x4f, 0xca, 0xfb, 0x5c, + 0x03, 0xd0, 0x15, 0x80, 0xb6, 0xde, 0x76, 0x1d, 0x73, 0xad, 0x69, 0xb4, 0xab, 0x07, 0x4f, 0x85, + 0xb5, 0xff, 0xfc, 0xe6, 0xc1, 0xcf, 0x47, 0xc1, 0x82, 0xbb, 0xae, 0x78, 0xfb, 0x3c, 0x8f, 0x0c, + 0x78, 0x10, 0xed, 0x84, 0x0e, 0xe6, 0x78, 0xc7, 0xa5, 0x9c, 0x44, 0x14, 0x7b, 0x3b, 0x62, 0x15, + 0xb7, 0xb2, 0x6e, 0xc7, 0x2a, 0x6b, 0xda, 0xae, 0x83, 0x8e, 0x01, 0x92, 0xac, 0x60, 0x26, 0x7a, + 0x9b, 0xd4, 0x9d, 0x21, 0x40, 0x9f, 0x82, 0xe9, 0x44, 0x41, 0x18, 0x12, 0xc7, 0x9e, 0x4a, 0xed, + 0x41, 0x30, 0xa6, 0xdc, 0x7c, 0xa7, 0x69, 0xb4, 0x6b, 0xd6, 0x86, 0xd6, 0x27, 0xa9, 0xc9, 0x9e, + 0x0a, 0x2d, 0xfa, 0x19, 0xbc, 0x1b, 0x44, 0xee, 0xc8, 0xa5, 0xd8, 0xb3, 0x43, 0x3c, 0xf1, 0x02, + 0xec, 0xd8, 0xc3, 0x20, 0xf2, 0x31, 0x37, 0xd7, 0x65, 0x8f, 0xbd, 0x17, 0xab, 0xcf, 0x94, 0xf6, + 0x48, 0x2a, 0x45, 0x23, 0x58, 0xdc, 0x67, 0xde, 0x13, 0x57, 0x65, 0xad, 0x2e, 0x6c, 0x68, 0xfd, + 0x01, 0x6a, 0x73, 0x05, 0x81, 0x3e, 0x81, 0x8d, 0x69, 0x91, 0xdd, 0x90, 0xc9, 0x34, 0x36, 0x86, + 0x8c, 0xcd, 0x7a, 0xa2, 0x7d, 0x4e, 0x26, 0x49, 0x58, 0x1e, 0x42, 0x4d, 0x14, 0xe4, 0x14, 0x9c, + 0x91, 0xe0, 0xaa, 0x10, 0xc6, 0xa0, 0xd6, 0xdf, 0x0d, 0xc8, 0x89, 0xf2, 0x40, 0x5f, 0x40, 0x89, + 0x47, 0x78, 0x20, 0x43, 0x68, 0xc8, 0x10, 0xee, 0xeb, 0x10, 0x3e, 0x49, 0x1f, 0xc2, 0xbe, 0x60, + 0xea, 0x76, 0xac, 0xa2, 0xa4, 0xec, 0x3a, 0xe8, 0x05, 0x14, 0x59, 0x88, 0xa9, 0x20, 0xcf, 0x48, + 0xf2, 0x5f, 0x69, 0xf2, 0x4f, 0xd3, 0x93, 0x9f, 0x87, 0x98, 0x76, 0x3b, 0x56, 0x41, 0x10, 0x76, + 0x9d, 0xd6, 0x3f, 0x0c, 0x28, 0x27, 0x55, 0x22, 0x9c, 0x9e, 0xcf, 0x5e, 0x75, 0x43, 0x55, 0x3e, + 0x9b, 0xb0, 0xdf, 0xe7, 0x66, 0xd0, 0x1f, 0xe1, 0x5d, 0x3c, 0x1a, 0x45, 0x64, 0xa4, 0x5f, 0x06, + 0xe2, 0x87, 0x41, 0x84, 0x3d, 0x97, 0x4f, 0xe4, 0x63, 0x5a, 0xdf, 0x3b, 0x48, 0xd5, 0xe1, 0xa6, + 0x54, 0xfd, 0x29, 0x93, 0xb5, 0x81, 0x97, 0xca, 0x5b, 0x5f, 0x66, 0xa0, 0xa0, 0x2a, 0x0d, 0xed, + 0xc1, 0xbd, 0xf8, 0xa5, 0x60, 0x36, 0xe3, 0x38, 0xe2, 0xf6, 0xac, 0x67, 0xef, 0x24, 0xca, 0x73, + 0xa1, 0xeb, 0x4a, 0xdb, 0x67, 0x5e, 0x1d, 0x66, 0x7b, 0x84, 0x8e, 0xf8, 0xb5, 0xf6, 0x31, 0x79, + 0x75, 0x58, 0x4f, 0x8a, 0xd1, 0x3a, 0xe4, 0x6f, 0xc5, 0xed, 0xc9, 0xf7, 0x34, 0x6b, 0xa9, 0x05, + 0xfa, 0x09, 0xac, 0x4d, 0x33, 0x2e, 0xee, 0x20, 0x39, 0xd9, 0x41, 0x1a, 0x89, 0x22, 0x7e, 0xb8, + 0x1e, 0xe8, 0xfe, 0xac, 0xcc, 0xca, 0x8b, 0x73, 0x3e, 0x5b, 0x51, 0xfd, 0x56, 0x99, 0xf3, 0x08, + 0xd6, 0x45, 0xeb, 0x64, 0x1c, 0xfb, 0x21, 0x13, 0xaf, 0xc4, 0x4b, 0xd9, 0x34, 0xe5, 0xfb, 0x96, + 0xb3, 0xd0, 0x54, 0x77, 0x41, 0xdd, 0x97, 0xa2, 0x73, 0x1e, 0xd4, 0xa0, 0x32, 0xa5, 0xb4, 0x5b, + 0x7f, 0x32, 0x20, 0xdf, 0xc3, 0x57, 0xc4, 0x13, 0xad, 0x7b, 0x49, 0x01, 0x54, 0x6e, 0x66, 0xf2, + 0x5e, 0x75, 0xf7, 0xc5, 0xe0, 0x8a, 0xee, 0x9e, 0x40, 0x1a, 0x90, 0xa5, 0x63, 0x5f, 0xc6, 0x31, + 0x6b, 0x89, 0x4f, 0xb4, 0x05, 0x6b, 0x74, 0xec, 0xdb, 0xf3, 0x69, 0x91, 0x53, 0x57, 0x46, 0xc7, + 0xfe, 0xc5, 0x6c, 0xcd, 0xfc, 0x27, 0x03, 0x45, 0x3d, 0x4a, 0x88, 0xc3, 0x7c, 0xe2, 0x07, 0xd1, + 0x44, 0x85, 0x46, 0xda, 0x93, 0xb3, 0x2a, 0x4a, 0x26, 0x23, 0x32, 0x03, 0xf1, 0x5c, 0xdf, 0xe5, + 0xd2, 0x9e, 0x04, 0xd2, 0x13, 0x22, 0xf4, 0x00, 0x2a, 0xb2, 0x7d, 0x06, 0xc3, 0x21, 0x23, 0x5c, + 0xda, 0x95, 0xb3, 0x40, 0x88, 0x4e, 0xa5, 0x44, 0xc4, 0x43, 0xac, 0x28, 0xf6, 0xc9, 0xa2, 0x79, + 0x8d, 0x58, 0x91, 0x78, 0xb7, 0x34, 0x78, 0xf9, 0x3b, 0x82, 0xf7, 0x10, 0x6a, 0xd7, 0x98, 0xd9, + 0xf1, 0xb4, 0xc0, 0xcc, 0x42, 0xd3, 0x68, 0x97, 0xac, 0xea, 0x35, 0x66, 0xf1, 0x2c, 0x31, 0x05, + 0xe9, 0x93, 0x98, 0x59, 0x9c, 0x82, 0x62, 0x19, 0x6a, 0x43, 0x43, 0x80, 0x3c, 0x97, 0x12, 0x9b, + 0x8e, 0xfd, 0x2b, 0x12, 0x89, 0x59, 0x40, 0xe0, 0xea, 0xd7, 0x98, 0xf5, 0x5c, 0x4a, 0x4e, 0x94, + 0x54, 0x5c, 0xb6, 0x40, 0xba, 0x54, 0x62, 0x87, 0x91, 0xa4, 0x2c, 0x4b, 0xe8, 0xea, 0x35, 0x66, + 0x5d, 0x29, 0x3f, 0x92, 0xe2, 0xd6, 0x7f, 0x0d, 0x28, 0xc5, 0xc3, 0x15, 0xfa, 0x60, 0x3a, 0x04, + 0xce, 0x84, 0xff, 0xb3, 0x95, 0x64, 0xa2, 0x53, 0xf9, 0x66, 0x42, 0x11, 0x3b, 0x4e, 0x44, 0x18, + 0xd3, 0x97, 0x1d, 0x2f, 0x51, 0x07, 0x72, 0x82, 0x5b, 0x0f, 0x8f, 0x69, 0x87, 0x08, 0x62, 0xc9, + 0xdd, 0xe8, 0x87, 0x50, 0x76, 0x99, 0x3d, 0x0c, 0x3c, 0x87, 0x38, 0x32, 0x0a, 0x25, 0xab, 0xe4, + 0xb2, 0x23, 0xb9, 0x4e, 0x75, 0xfb, 0x07, 0x0d, 0xa8, 0xcf, 0x39, 0x64, 0xb7, 0x5e, 0xc8, 0x7e, + 0x4c, 0xc4, 0x84, 0x91, 0x4c, 0x83, 0xb3, 0xa9, 0x9e, 0xcc, 0x75, 0xca, 0x55, 0xa4, 0x1d, 0xca, + 0xc8, 0x54, 0x56, 0xe6, 0x6d, 0x40, 0x61, 0x10, 0x78, 0x63, 0x9f, 0xea, 0x04, 0xd7, 0xab, 0xd6, + 0xdf, 0x0c, 0x28, 0xc5, 0x31, 0x15, 0x21, 0x9d, 0xcf, 0x26, 0xdd, 0x28, 0xe7, 0x32, 0xe9, 0x11, + 0xac, 0xb3, 0x09, 0xe3, 0xc4, 0xb7, 0xe7, 0xb1, 0xaa, 0xa4, 0x90, 0xd2, 0x9d, 0x2c, 0xe4, 0xde, + 0xff, 0x27, 0x6a, 0xf6, 0x8e, 0x44, 0x15, 0xff, 0xa2, 0xc8, 0x86, 0x26, 0x5d, 0xc8, 0xa9, 0x21, + 0x4b, 0x4a, 0xc4, 0x15, 0x6c, 0x7d, 0x69, 0xc0, 0xc6, 0xf2, 0xbe, 0x89, 0x3e, 0x84, 0x87, 0xfb, + 0xcf, 0x9e, 0x59, 0x87, 0xcf, 0xf6, 0xfb, 0xdd, 0xd3, 0x13, 0xbb, 0x7f, 0x78, 0x7c, 0x76, 0x6a, + 0xed, 0xf7, 0xba, 0xfd, 0x17, 0xf6, 0xc5, 0xc9, 0xf9, 0xd9, 0xe1, 0xd3, 0xee, 0x51, 0xf7, 0xb0, + 0xd3, 0x58, 0x41, 0xef, 0xc3, 0xfd, 0xbb, 0x80, 0x9d, 0xc3, 0x5e, 0x7f, 0xbf, 0x61, 0xa0, 0x1f, + 0x43, 0xeb, 0x2e, 0xc8, 0xd3, 0x8b, 0xe3, 0x8b, 0xde, 0x7e, 0xbf, 0x7b, 0x79, 0xd8, 0xc8, 0x1c, + 0x7c, 0x6d, 0x7c, 0xf5, 0x7a, 0xd3, 0x78, 0xf5, 0x7a, 0xd3, 0xf8, 0xd7, 0xeb, 0x4d, 0xe3, 0xcf, + 0x6f, 0x36, 0x57, 0x5e, 0xbd, 0xd9, 0x5c, 0xf9, 0xfa, 0xcd, 0xe6, 0x0a, 0x7c, 0xec, 0x06, 0x29, + 0x52, 0xe9, 0xa0, 0x16, 0xff, 0x1b, 0x79, 0x26, 0x50, 0x67, 0xc6, 0x6f, 0x7f, 0x9d, 0xfa, 0x15, + 0x54, 0xbf, 0x0c, 0x8c, 0x08, 0xbd, 0xe3, 0x57, 0x8c, 0xbf, 0x66, 0xb6, 0x4e, 0x43, 0x42, 0xfb, + 0x09, 0xa1, 0x3c, 0x2a, 0x9e, 0xad, 0xd8, 0xf6, 0xe5, 0x6e, 0x67, 0x0a, 0xbe, 0x2a, 0x48, 0xb6, + 0xc7, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x31, 0xf3, 0xe8, 0x27, 0x11, 0x00, 0x00, +} + +func (m *ProfilesData) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1276,92 +1465,225 @@ func (m *Profile) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Profile) MarshalTo(dAtA []byte) (int, error) { +func (m *ProfilesData) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Profile) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ProfilesData) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.LinkTable) > 0 { - for iNdEx := len(m.LinkTable) - 1; iNdEx >= 0; iNdEx-- { + if len(m.ResourceProfiles) > 0 { + for iNdEx := len(m.ResourceProfiles) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.LinkTable[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ResourceProfiles[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintPprofextended(dAtA, i, uint64(size)) + i = encodeVarintProfiles(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 + dAtA[i] = 0xa } } - if len(m.AttributeUnits) > 0 { - for iNdEx := len(m.AttributeUnits) - 1; iNdEx >= 0; iNdEx-- { + return len(dAtA) - i, nil +} + +func (m *ResourceProfiles) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResourceProfiles) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceProfiles) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SchemaUrl) > 0 { + i -= len(m.SchemaUrl) + copy(dAtA[i:], m.SchemaUrl) + i = encodeVarintProfiles(dAtA, i, uint64(len(m.SchemaUrl))) + i-- + dAtA[i] = 0x1a + } + if len(m.ScopeProfiles) > 0 { + for iNdEx := len(m.ScopeProfiles) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.AttributeUnits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ScopeProfiles[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintPprofextended(dAtA, i, uint64(size)) + i = encodeVarintProfiles(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a + dAtA[i] = 0x12 } } - if len(m.AttributeTable) > 0 { - for iNdEx := len(m.AttributeTable) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProfiles(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ScopeProfiles) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ScopeProfiles) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ScopeProfiles) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SchemaUrl) > 0 { + i -= len(m.SchemaUrl) + copy(dAtA[i:], m.SchemaUrl) + i = encodeVarintProfiles(dAtA, i, uint64(len(m.SchemaUrl))) + i-- + dAtA[i] = 0x1a + } + if len(m.Profiles) > 0 { + for iNdEx := len(m.Profiles) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.AttributeTable[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Profiles[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintPprofextended(dAtA, i, uint64(size)) + i = encodeVarintProfiles(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 + dAtA[i] = 0x12 } } - if len(m.LocationIndices) > 0 { - dAtA2 := make([]byte, len(m.LocationIndices)*10) - var j1 int - for _, num1 := range m.LocationIndices { - num := uint64(num1) - for num >= 1<<7 { - dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j1++ - } - dAtA2[j1] = uint8(num) - j1++ + { + size, err := m.Scope.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i -= j1 - copy(dAtA[i:], dAtA2[:j1]) - i = encodeVarintPprofextended(dAtA, i, uint64(j1)) - i-- - dAtA[i] = 0x7a + i -= size + i = encodeVarintProfiles(dAtA, i, uint64(size)) } - if m.DefaultSampleType != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.DefaultSampleType)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Profile) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Profile) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Profile) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.OriginalPayload) > 0 { + i -= len(m.OriginalPayload) + copy(dAtA[i:], m.OriginalPayload) + i = encodeVarintProfiles(dAtA, i, uint64(len(m.OriginalPayload))) i-- - dAtA[i] = 0x70 + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + if len(m.OriginalPayloadFormat) > 0 { + i -= len(m.OriginalPayloadFormat) + copy(dAtA[i:], m.OriginalPayloadFormat) + i = encodeVarintProfiles(dAtA, i, uint64(len(m.OriginalPayloadFormat))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + if m.DroppedAttributesCount != 0 { + i = encodeVarintProfiles(dAtA, i, uint64(m.DroppedAttributesCount)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 + } + if len(m.Attributes) > 0 { + for iNdEx := len(m.Attributes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Attributes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProfiles(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + } + { + size := m.ProfileId.Size() + i -= size + if _, err := m.ProfileId.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintProfiles(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + if m.DefaultSampleTypeStrindex != 0 { + i = encodeVarintProfiles(dAtA, i, uint64(m.DefaultSampleTypeStrindex)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 } - if len(m.Comment) > 0 { - dAtA4 := make([]byte, len(m.Comment)*10) + if len(m.CommentStrindices) > 0 { + dAtA4 := make([]byte, len(m.CommentStrindices)*10) var j3 int - for _, num1 := range m.Comment { + for _, num1 := range m.CommentStrindices { num := uint64(num1) for num >= 1<<7 { dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) @@ -1373,14 +1695,14 @@ func (m *Profile) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i -= j3 copy(dAtA[i:], dAtA4[:j3]) - i = encodeVarintPprofextended(dAtA, i, uint64(j3)) + i = encodeVarintProfiles(dAtA, i, uint64(j3)) i-- - dAtA[i] = 0x6a + dAtA[i] = 0x7a } if m.Period != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.Period)) + i = encodeVarintProfiles(dAtA, i, uint64(m.Period)) i-- - dAtA[i] = 0x60 + dAtA[i] = 0x70 } { size, err := m.PeriodType.MarshalToSizedBuffer(dAtA[:i]) @@ -1388,76 +1710,127 @@ func (m *Profile) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintPprofextended(dAtA, i, uint64(size)) + i = encodeVarintProfiles(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x5a + dAtA[i] = 0x6a if m.DurationNanos != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.DurationNanos)) + i = encodeVarintProfiles(dAtA, i, uint64(m.DurationNanos)) i-- - dAtA[i] = 0x50 + dAtA[i] = 0x60 } if m.TimeNanos != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.TimeNanos)) - i-- - dAtA[i] = 0x48 - } - if m.KeepFrames != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.KeepFrames)) - i-- - dAtA[i] = 0x40 - } - if m.DropFrames != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.DropFrames)) + i = encodeVarintProfiles(dAtA, i, uint64(m.TimeNanos)) i-- - dAtA[i] = 0x38 + dAtA[i] = 0x58 } if len(m.StringTable) > 0 { for iNdEx := len(m.StringTable) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.StringTable[iNdEx]) copy(dAtA[i:], m.StringTable[iNdEx]) - i = encodeVarintPprofextended(dAtA, i, uint64(len(m.StringTable[iNdEx]))) + i = encodeVarintProfiles(dAtA, i, uint64(len(m.StringTable[iNdEx]))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x52 + } + } + if len(m.LinkTable) > 0 { + for iNdEx := len(m.LinkTable) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LinkTable[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProfiles(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if len(m.AttributeUnits) > 0 { + for iNdEx := len(m.AttributeUnits) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AttributeUnits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProfiles(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if len(m.AttributeTable) > 0 { + for iNdEx := len(m.AttributeTable) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AttributeTable[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProfiles(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a } } - if len(m.Function) > 0 { - for iNdEx := len(m.Function) - 1; iNdEx >= 0; iNdEx-- { + if len(m.FunctionTable) > 0 { + for iNdEx := len(m.FunctionTable) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Function[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.FunctionTable[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintPprofextended(dAtA, i, uint64(size)) + i = encodeVarintProfiles(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x32 + } + } + if len(m.LocationIndices) > 0 { + dAtA7 := make([]byte, len(m.LocationIndices)*10) + var j6 int + for _, num1 := range m.LocationIndices { + num := uint64(num1) + for num >= 1<<7 { + dAtA7[j6] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j6++ + } + dAtA7[j6] = uint8(num) + j6++ } + i -= j6 + copy(dAtA[i:], dAtA7[:j6]) + i = encodeVarintProfiles(dAtA, i, uint64(j6)) + i-- + dAtA[i] = 0x2a } - if len(m.Location) > 0 { - for iNdEx := len(m.Location) - 1; iNdEx >= 0; iNdEx-- { + if len(m.LocationTable) > 0 { + for iNdEx := len(m.LocationTable) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Location[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.LocationTable[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintPprofextended(dAtA, i, uint64(size)) + i = encodeVarintProfiles(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } } - if len(m.Mapping) > 0 { - for iNdEx := len(m.Mapping) - 1; iNdEx >= 0; iNdEx-- { + if len(m.MappingTable) > 0 { + for iNdEx := len(m.MappingTable) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Mapping[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.MappingTable[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintPprofextended(dAtA, i, uint64(size)) + i = encodeVarintProfiles(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -1471,7 +1844,7 @@ func (m *Profile) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintPprofextended(dAtA, i, uint64(size)) + i = encodeVarintProfiles(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 @@ -1485,7 +1858,7 @@ func (m *Profile) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintPprofextended(dAtA, i, uint64(size)) + i = encodeVarintProfiles(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa @@ -1514,13 +1887,13 @@ func (m *AttributeUnit) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Unit != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.Unit)) + if m.UnitStrindex != 0 { + i = encodeVarintProfiles(dAtA, i, uint64(m.UnitStrindex)) i-- dAtA[i] = 0x10 } - if m.AttributeKey != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.AttributeKey)) + if m.AttributeKeyStrindex != 0 { + i = encodeVarintProfiles(dAtA, i, uint64(m.AttributeKeyStrindex)) i-- dAtA[i] = 0x8 } @@ -1553,7 +1926,7 @@ func (m *Link) MarshalToSizedBuffer(dAtA []byte) (int, error) { if _, err := m.SpanId.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i = encodeVarintPprofextended(dAtA, i, uint64(size)) + i = encodeVarintProfiles(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 @@ -1563,7 +1936,7 @@ func (m *Link) MarshalToSizedBuffer(dAtA []byte) (int, error) { if _, err := m.TraceId.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i = encodeVarintPprofextended(dAtA, i, uint64(size)) + i = encodeVarintProfiles(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa @@ -1591,17 +1964,17 @@ func (m *ValueType) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if m.AggregationTemporality != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.AggregationTemporality)) + i = encodeVarintProfiles(dAtA, i, uint64(m.AggregationTemporality)) i-- dAtA[i] = 0x18 } - if m.Unit != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.Unit)) + if m.UnitStrindex != 0 { + i = encodeVarintProfiles(dAtA, i, uint64(m.UnitStrindex)) i-- dAtA[i] = 0x10 } - if m.Type != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.Type)) + if m.TypeStrindex != 0 { + i = encodeVarintProfiles(dAtA, i, uint64(m.TypeStrindex)) i-- dAtA[i] = 0x8 } @@ -1629,32 +2002,9 @@ func (m *Sample) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.TimestampsUnixNano) > 0 { - dAtA7 := make([]byte, len(m.TimestampsUnixNano)*10) - var j6 int - for _, num := range m.TimestampsUnixNano { - for num >= 1<<7 { - dAtA7[j6] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j6++ - } - dAtA7[j6] = uint8(num) - j6++ - } - i -= j6 - copy(dAtA[i:], dAtA7[:j6]) - i = encodeVarintPprofextended(dAtA, i, uint64(j6)) - i-- - dAtA[i] = 0x6a - } - if m.Link != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.Link)) - i-- - dAtA[i] = 0x60 - } - if len(m.Attributes) > 0 { - dAtA9 := make([]byte, len(m.Attributes)*10) + dAtA9 := make([]byte, len(m.TimestampsUnixNano)*10) var j8 int - for _, num := range m.Attributes { + for _, num := range m.TimestampsUnixNano { for num >= 1<<7 { dAtA9[j8] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 @@ -1665,43 +2015,23 @@ func (m *Sample) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i -= j8 copy(dAtA[i:], dAtA9[:j8]) - i = encodeVarintPprofextended(dAtA, i, uint64(j8)) - i-- - dAtA[i] = 0x52 - } - if m.StacktraceIdIndex != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.StacktraceIdIndex)) - i-- - dAtA[i] = 0x48 - } - if m.LocationsLength != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.LocationsLength)) - i-- - dAtA[i] = 0x40 - } - if m.LocationsStartIndex != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.LocationsStartIndex)) + i = encodeVarintProfiles(dAtA, i, uint64(j8)) i-- - dAtA[i] = 0x38 + dAtA[i] = 0x32 } - if len(m.Label) > 0 { - for iNdEx := len(m.Label) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Label[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPprofextended(dAtA, i, uint64(size)) + if m.LinkIndex_ != nil { + { + size := m.LinkIndex_.Size() + i -= size + if _, err := m.LinkIndex_.MarshalTo(dAtA[i:]); err != nil { + return 0, err } - i-- - dAtA[i] = 0x1a } } - if len(m.Value) > 0 { - dAtA11 := make([]byte, len(m.Value)*10) + if len(m.AttributeIndices) > 0 { + dAtA11 := make([]byte, len(m.AttributeIndices)*10) var j10 int - for _, num1 := range m.Value { + for _, num1 := range m.AttributeIndices { num := uint64(num1) for num >= 1<<7 { dAtA11[j10] = uint8(uint64(num)&0x7f | 0x80) @@ -1713,14 +2043,15 @@ func (m *Sample) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i -= j10 copy(dAtA[i:], dAtA11[:j10]) - i = encodeVarintPprofextended(dAtA, i, uint64(j10)) + i = encodeVarintProfiles(dAtA, i, uint64(j10)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x22 } - if len(m.LocationIndex) > 0 { - dAtA13 := make([]byte, len(m.LocationIndex)*10) + if len(m.Value) > 0 { + dAtA13 := make([]byte, len(m.Value)*10) var j12 int - for _, num := range m.LocationIndex { + for _, num1 := range m.Value { + num := uint64(num1) for num >= 1<<7 { dAtA13[j12] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 @@ -1731,13 +2062,35 @@ func (m *Sample) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i -= j12 copy(dAtA[i:], dAtA13[:j12]) - i = encodeVarintPprofextended(dAtA, i, uint64(j12)) + i = encodeVarintProfiles(dAtA, i, uint64(j12)) + i-- + dAtA[i] = 0x1a + } + if m.LocationsLength != 0 { + i = encodeVarintProfiles(dAtA, i, uint64(m.LocationsLength)) + i-- + dAtA[i] = 0x10 + } + if m.LocationsStartIndex != 0 { + i = encodeVarintProfiles(dAtA, i, uint64(m.LocationsStartIndex)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } return len(dAtA) - i, nil } +func (m *Sample_LinkIndex) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Sample_LinkIndex) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintProfiles(dAtA, i, uint64(m.LinkIndex)) + i-- + dAtA[i] = 0x28 + return len(dAtA) - i, nil +} func (m *Label) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1758,23 +2111,23 @@ func (m *Label) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.NumUnit != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.NumUnit)) + if m.NumUnitStrindex != 0 { + i = encodeVarintProfiles(dAtA, i, uint64(m.NumUnitStrindex)) i-- dAtA[i] = 0x20 } if m.Num != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.Num)) + i = encodeVarintProfiles(dAtA, i, uint64(m.Num)) i-- dAtA[i] = 0x18 } - if m.Str != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.Str)) + if m.StrStrindex != 0 { + i = encodeVarintProfiles(dAtA, i, uint64(m.StrStrindex)) i-- dAtA[i] = 0x10 } - if m.Key != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.Key)) + if m.KeyStrindex != 0 { + i = encodeVarintProfiles(dAtA, i, uint64(m.KeyStrindex)) i-- dAtA[i] = 0x8 } @@ -1801,29 +2154,6 @@ func (m *Mapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Attributes) > 0 { - dAtA15 := make([]byte, len(m.Attributes)*10) - var j14 int - for _, num := range m.Attributes { - for num >= 1<<7 { - dAtA15[j14] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j14++ - } - dAtA15[j14] = uint8(num) - j14++ - } - i -= j14 - copy(dAtA[i:], dAtA15[:j14]) - i = encodeVarintPprofextended(dAtA, i, uint64(j14)) - i-- - dAtA[i] = 0x62 - } - if m.BuildIdKind != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.BuildIdKind)) - i-- - dAtA[i] = 0x58 - } if m.HasInlineFrames { i-- if m.HasInlineFrames { @@ -1832,7 +2162,7 @@ func (m *Mapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x50 + dAtA[i] = 0x48 } if m.HasLineNumbers { i-- @@ -1842,7 +2172,7 @@ func (m *Mapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x48 + dAtA[i] = 0x40 } if m.HasFilenames { i-- @@ -1852,7 +2182,7 @@ func (m *Mapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x40 + dAtA[i] = 0x38 } if m.HasFunctions { i-- @@ -1862,35 +2192,44 @@ func (m *Mapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x38 - } - if m.BuildId != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.BuildId)) - i-- dAtA[i] = 0x30 } - if m.Filename != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.Filename)) + if len(m.AttributeIndices) > 0 { + dAtA15 := make([]byte, len(m.AttributeIndices)*10) + var j14 int + for _, num1 := range m.AttributeIndices { + num := uint64(num1) + for num >= 1<<7 { + dAtA15[j14] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j14++ + } + dAtA15[j14] = uint8(num) + j14++ + } + i -= j14 + copy(dAtA[i:], dAtA15[:j14]) + i = encodeVarintProfiles(dAtA, i, uint64(j14)) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x2a } - if m.FileOffset != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.FileOffset)) + if m.FilenameStrindex != 0 { + i = encodeVarintProfiles(dAtA, i, uint64(m.FilenameStrindex)) i-- dAtA[i] = 0x20 } - if m.MemoryLimit != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.MemoryLimit)) + if m.FileOffset != 0 { + i = encodeVarintProfiles(dAtA, i, uint64(m.FileOffset)) i-- dAtA[i] = 0x18 } - if m.MemoryStart != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.MemoryStart)) + if m.MemoryLimit != 0 { + i = encodeVarintProfiles(dAtA, i, uint64(m.MemoryLimit)) i-- dAtA[i] = 0x10 } - if m.Id != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.Id)) + if m.MemoryStart != 0 { + i = encodeVarintProfiles(dAtA, i, uint64(m.MemoryStart)) i-- dAtA[i] = 0x8 } @@ -1917,10 +2256,11 @@ func (m *Location) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Attributes) > 0 { - dAtA17 := make([]byte, len(m.Attributes)*10) + if len(m.AttributeIndices) > 0 { + dAtA17 := make([]byte, len(m.AttributeIndices)*10) var j16 int - for _, num := range m.Attributes { + for _, num1 := range m.AttributeIndices { + num := uint64(num1) for num >= 1<<7 { dAtA17[j16] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 @@ -1931,14 +2271,9 @@ func (m *Location) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i -= j16 copy(dAtA[i:], dAtA17[:j16]) - i = encodeVarintPprofextended(dAtA, i, uint64(j16)) - i-- - dAtA[i] = 0x3a - } - if m.TypeIndex != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.TypeIndex)) + i = encodeVarintProfiles(dAtA, i, uint64(j16)) i-- - dAtA[i] = 0x30 + dAtA[i] = 0x2a } if m.IsFolded { i-- @@ -1948,7 +2283,7 @@ func (m *Location) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x28 + dAtA[i] = 0x20 } if len(m.Line) > 0 { for iNdEx := len(m.Line) - 1; iNdEx >= 0; iNdEx-- { @@ -1958,30 +2293,41 @@ func (m *Location) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintPprofextended(dAtA, i, uint64(size)) + i = encodeVarintProfiles(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a } } if m.Address != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.Address)) - i-- - dAtA[i] = 0x18 - } - if m.MappingIndex != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.MappingIndex)) + i = encodeVarintProfiles(dAtA, i, uint64(m.Address)) i-- dAtA[i] = 0x10 } - if m.Id != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 + if m.MappingIndex_ != nil { + { + size := m.MappingIndex_.Size() + i -= size + if _, err := m.MappingIndex_.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } return len(dAtA) - i, nil } +func (m *Location_MappingIndex) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Location_MappingIndex) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintProfiles(dAtA, i, uint64(m.MappingIndex)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} func (m *Line) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2003,17 +2349,17 @@ func (m *Line) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if m.Column != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.Column)) + i = encodeVarintProfiles(dAtA, i, uint64(m.Column)) i-- dAtA[i] = 0x18 } if m.Line != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.Line)) + i = encodeVarintProfiles(dAtA, i, uint64(m.Line)) i-- dAtA[i] = 0x10 } if m.FunctionIndex != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.FunctionIndex)) + i = encodeVarintProfiles(dAtA, i, uint64(m.FunctionIndex)) i-- dAtA[i] = 0x8 } @@ -2041,35 +2387,30 @@ func (m *Function) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if m.StartLine != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.StartLine)) - i-- - dAtA[i] = 0x28 - } - if m.Filename != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.Filename)) + i = encodeVarintProfiles(dAtA, i, uint64(m.StartLine)) i-- dAtA[i] = 0x20 } - if m.SystemName != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.SystemName)) + if m.FilenameStrindex != 0 { + i = encodeVarintProfiles(dAtA, i, uint64(m.FilenameStrindex)) i-- dAtA[i] = 0x18 } - if m.Name != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.Name)) + if m.SystemNameStrindex != 0 { + i = encodeVarintProfiles(dAtA, i, uint64(m.SystemNameStrindex)) i-- dAtA[i] = 0x10 } - if m.Id != 0 { - i = encodeVarintPprofextended(dAtA, i, uint64(m.Id)) + if m.NameStrindex != 0 { + i = encodeVarintProfiles(dAtA, i, uint64(m.NameStrindex)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func encodeVarintPprofextended(dAtA []byte, offset int, v uint64) int { - offset -= sovPprofextended(v) +func encodeVarintProfiles(dAtA []byte, offset int, v uint64) int { + offset -= sovProfiles(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -2079,100 +2420,170 @@ func encodeVarintPprofextended(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *Profile) Size() (n int) { +func (m *ProfilesData) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.SampleType) > 0 { - for _, e := range m.SampleType { - l = e.Size() - n += 1 + l + sovPprofextended(uint64(l)) - } - } - if len(m.Sample) > 0 { - for _, e := range m.Sample { + if len(m.ResourceProfiles) > 0 { + for _, e := range m.ResourceProfiles { l = e.Size() - n += 1 + l + sovPprofextended(uint64(l)) + n += 1 + l + sovProfiles(uint64(l)) } } - if len(m.Mapping) > 0 { - for _, e := range m.Mapping { - l = e.Size() - n += 1 + l + sovPprofextended(uint64(l)) - } + return n +} + +func (m *ResourceProfiles) Size() (n int) { + if m == nil { + return 0 } - if len(m.Location) > 0 { - for _, e := range m.Location { + var l int + _ = l + l = m.Resource.Size() + n += 1 + l + sovProfiles(uint64(l)) + if len(m.ScopeProfiles) > 0 { + for _, e := range m.ScopeProfiles { l = e.Size() - n += 1 + l + sovPprofextended(uint64(l)) + n += 1 + l + sovProfiles(uint64(l)) } } - if len(m.Function) > 0 { - for _, e := range m.Function { - l = e.Size() - n += 1 + l + sovPprofextended(uint64(l)) - } + l = len(m.SchemaUrl) + if l > 0 { + n += 1 + l + sovProfiles(uint64(l)) } - if len(m.StringTable) > 0 { - for _, s := range m.StringTable { - l = len(s) - n += 1 + l + sovPprofextended(uint64(l)) - } + return n +} + +func (m *ScopeProfiles) Size() (n int) { + if m == nil { + return 0 } - if m.DropFrames != 0 { - n += 1 + sovPprofextended(uint64(m.DropFrames)) + var l int + _ = l + l = m.Scope.Size() + n += 1 + l + sovProfiles(uint64(l)) + if len(m.Profiles) > 0 { + for _, e := range m.Profiles { + l = e.Size() + n += 1 + l + sovProfiles(uint64(l)) + } } - if m.KeepFrames != 0 { - n += 1 + sovPprofextended(uint64(m.KeepFrames)) + l = len(m.SchemaUrl) + if l > 0 { + n += 1 + l + sovProfiles(uint64(l)) } - if m.TimeNanos != 0 { - n += 1 + sovPprofextended(uint64(m.TimeNanos)) + return n +} + +func (m *Profile) Size() (n int) { + if m == nil { + return 0 } - if m.DurationNanos != 0 { - n += 1 + sovPprofextended(uint64(m.DurationNanos)) + var l int + _ = l + if len(m.SampleType) > 0 { + for _, e := range m.SampleType { + l = e.Size() + n += 1 + l + sovProfiles(uint64(l)) + } } - l = m.PeriodType.Size() - n += 1 + l + sovPprofextended(uint64(l)) - if m.Period != 0 { - n += 1 + sovPprofextended(uint64(m.Period)) + if len(m.Sample) > 0 { + for _, e := range m.Sample { + l = e.Size() + n += 1 + l + sovProfiles(uint64(l)) + } } - if len(m.Comment) > 0 { - l = 0 - for _, e := range m.Comment { - l += sovPprofextended(uint64(e)) + if len(m.MappingTable) > 0 { + for _, e := range m.MappingTable { + l = e.Size() + n += 1 + l + sovProfiles(uint64(l)) } - n += 1 + sovPprofextended(uint64(l)) + l } - if m.DefaultSampleType != 0 { - n += 1 + sovPprofextended(uint64(m.DefaultSampleType)) + if len(m.LocationTable) > 0 { + for _, e := range m.LocationTable { + l = e.Size() + n += 1 + l + sovProfiles(uint64(l)) + } } if len(m.LocationIndices) > 0 { l = 0 for _, e := range m.LocationIndices { - l += sovPprofextended(uint64(e)) + l += sovProfiles(uint64(e)) + } + n += 1 + sovProfiles(uint64(l)) + l + } + if len(m.FunctionTable) > 0 { + for _, e := range m.FunctionTable { + l = e.Size() + n += 1 + l + sovProfiles(uint64(l)) } - n += 1 + sovPprofextended(uint64(l)) + l } if len(m.AttributeTable) > 0 { for _, e := range m.AttributeTable { l = e.Size() - n += 2 + l + sovPprofextended(uint64(l)) + n += 1 + l + sovProfiles(uint64(l)) } } if len(m.AttributeUnits) > 0 { for _, e := range m.AttributeUnits { l = e.Size() - n += 2 + l + sovPprofextended(uint64(l)) + n += 1 + l + sovProfiles(uint64(l)) } } if len(m.LinkTable) > 0 { for _, e := range m.LinkTable { l = e.Size() - n += 2 + l + sovPprofextended(uint64(l)) + n += 1 + l + sovProfiles(uint64(l)) + } + } + if len(m.StringTable) > 0 { + for _, s := range m.StringTable { + l = len(s) + n += 1 + l + sovProfiles(uint64(l)) + } + } + if m.TimeNanos != 0 { + n += 1 + sovProfiles(uint64(m.TimeNanos)) + } + if m.DurationNanos != 0 { + n += 1 + sovProfiles(uint64(m.DurationNanos)) + } + l = m.PeriodType.Size() + n += 1 + l + sovProfiles(uint64(l)) + if m.Period != 0 { + n += 1 + sovProfiles(uint64(m.Period)) + } + if len(m.CommentStrindices) > 0 { + l = 0 + for _, e := range m.CommentStrindices { + l += sovProfiles(uint64(e)) + } + n += 1 + sovProfiles(uint64(l)) + l + } + if m.DefaultSampleTypeStrindex != 0 { + n += 2 + sovProfiles(uint64(m.DefaultSampleTypeStrindex)) + } + l = m.ProfileId.Size() + n += 2 + l + sovProfiles(uint64(l)) + if len(m.Attributes) > 0 { + for _, e := range m.Attributes { + l = e.Size() + n += 2 + l + sovProfiles(uint64(l)) } } + if m.DroppedAttributesCount != 0 { + n += 2 + sovProfiles(uint64(m.DroppedAttributesCount)) + } + l = len(m.OriginalPayloadFormat) + if l > 0 { + n += 2 + l + sovProfiles(uint64(l)) + } + l = len(m.OriginalPayload) + if l > 0 { + n += 2 + l + sovProfiles(uint64(l)) + } return n } @@ -2182,11 +2593,11 @@ func (m *AttributeUnit) Size() (n int) { } var l int _ = l - if m.AttributeKey != 0 { - n += 1 + sovPprofextended(uint64(m.AttributeKey)) + if m.AttributeKeyStrindex != 0 { + n += 1 + sovProfiles(uint64(m.AttributeKeyStrindex)) } - if m.Unit != 0 { - n += 1 + sovPprofextended(uint64(m.Unit)) + if m.UnitStrindex != 0 { + n += 1 + sovProfiles(uint64(m.UnitStrindex)) } return n } @@ -2198,9 +2609,9 @@ func (m *Link) Size() (n int) { var l int _ = l l = m.TraceId.Size() - n += 1 + l + sovPprofextended(uint64(l)) + n += 1 + l + sovProfiles(uint64(l)) l = m.SpanId.Size() - n += 1 + l + sovPprofextended(uint64(l)) + n += 1 + l + sovProfiles(uint64(l)) return n } @@ -2210,14 +2621,14 @@ func (m *ValueType) Size() (n int) { } var l int _ = l - if m.Type != 0 { - n += 1 + sovPprofextended(uint64(m.Type)) + if m.TypeStrindex != 0 { + n += 1 + sovProfiles(uint64(m.TypeStrindex)) } - if m.Unit != 0 { - n += 1 + sovPprofextended(uint64(m.Unit)) + if m.UnitStrindex != 0 { + n += 1 + sovProfiles(uint64(m.UnitStrindex)) } if m.AggregationTemporality != 0 { - n += 1 + sovPprofextended(uint64(m.AggregationTemporality)) + n += 1 + sovProfiles(uint64(m.AggregationTemporality)) } return n } @@ -2228,72 +2639,65 @@ func (m *Sample) Size() (n int) { } var l int _ = l - if len(m.LocationIndex) > 0 { - l = 0 - for _, e := range m.LocationIndex { - l += sovPprofextended(uint64(e)) - } - n += 1 + sovPprofextended(uint64(l)) + l + if m.LocationsStartIndex != 0 { + n += 1 + sovProfiles(uint64(m.LocationsStartIndex)) + } + if m.LocationsLength != 0 { + n += 1 + sovProfiles(uint64(m.LocationsLength)) } if len(m.Value) > 0 { l = 0 for _, e := range m.Value { - l += sovPprofextended(uint64(e)) + l += sovProfiles(uint64(e)) } - n += 1 + sovPprofextended(uint64(l)) + l + n += 1 + sovProfiles(uint64(l)) + l } - if len(m.Label) > 0 { - for _, e := range m.Label { - l = e.Size() - n += 1 + l + sovPprofextended(uint64(l)) - } - } - if m.LocationsStartIndex != 0 { - n += 1 + sovPprofextended(uint64(m.LocationsStartIndex)) - } - if m.LocationsLength != 0 { - n += 1 + sovPprofextended(uint64(m.LocationsLength)) - } - if m.StacktraceIdIndex != 0 { - n += 1 + sovPprofextended(uint64(m.StacktraceIdIndex)) - } - if len(m.Attributes) > 0 { + if len(m.AttributeIndices) > 0 { l = 0 - for _, e := range m.Attributes { - l += sovPprofextended(uint64(e)) + for _, e := range m.AttributeIndices { + l += sovProfiles(uint64(e)) } - n += 1 + sovPprofextended(uint64(l)) + l + n += 1 + sovProfiles(uint64(l)) + l } - if m.Link != 0 { - n += 1 + sovPprofextended(uint64(m.Link)) + if m.LinkIndex_ != nil { + n += m.LinkIndex_.Size() } if len(m.TimestampsUnixNano) > 0 { l = 0 for _, e := range m.TimestampsUnixNano { - l += sovPprofextended(uint64(e)) + l += sovProfiles(uint64(e)) } - n += 1 + sovPprofextended(uint64(l)) + l + n += 1 + sovProfiles(uint64(l)) + l } return n } +func (m *Sample_LinkIndex) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovProfiles(uint64(m.LinkIndex)) + return n +} func (m *Label) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Key != 0 { - n += 1 + sovPprofextended(uint64(m.Key)) + if m.KeyStrindex != 0 { + n += 1 + sovProfiles(uint64(m.KeyStrindex)) } - if m.Str != 0 { - n += 1 + sovPprofextended(uint64(m.Str)) + if m.StrStrindex != 0 { + n += 1 + sovProfiles(uint64(m.StrStrindex)) } if m.Num != 0 { - n += 1 + sovPprofextended(uint64(m.Num)) + n += 1 + sovProfiles(uint64(m.Num)) } - if m.NumUnit != 0 { - n += 1 + sovPprofextended(uint64(m.NumUnit)) + if m.NumUnitStrindex != 0 { + n += 1 + sovProfiles(uint64(m.NumUnitStrindex)) } return n } @@ -2304,23 +2708,24 @@ func (m *Mapping) Size() (n int) { } var l int _ = l - if m.Id != 0 { - n += 1 + sovPprofextended(uint64(m.Id)) - } if m.MemoryStart != 0 { - n += 1 + sovPprofextended(uint64(m.MemoryStart)) + n += 1 + sovProfiles(uint64(m.MemoryStart)) } if m.MemoryLimit != 0 { - n += 1 + sovPprofextended(uint64(m.MemoryLimit)) + n += 1 + sovProfiles(uint64(m.MemoryLimit)) } if m.FileOffset != 0 { - n += 1 + sovPprofextended(uint64(m.FileOffset)) + n += 1 + sovProfiles(uint64(m.FileOffset)) } - if m.Filename != 0 { - n += 1 + sovPprofextended(uint64(m.Filename)) + if m.FilenameStrindex != 0 { + n += 1 + sovProfiles(uint64(m.FilenameStrindex)) } - if m.BuildId != 0 { - n += 1 + sovPprofextended(uint64(m.BuildId)) + if len(m.AttributeIndices) > 0 { + l = 0 + for _, e := range m.AttributeIndices { + l += sovProfiles(uint64(e)) + } + n += 1 + sovProfiles(uint64(l)) + l } if m.HasFunctions { n += 2 @@ -2334,16 +2739,6 @@ func (m *Mapping) Size() (n int) { if m.HasInlineFrames { n += 2 } - if m.BuildIdKind != 0 { - n += 1 + sovPprofextended(uint64(m.BuildIdKind)) - } - if len(m.Attributes) > 0 { - l = 0 - for _, e := range m.Attributes { - l += sovPprofextended(uint64(e)) - } - n += 1 + sovPprofextended(uint64(l)) + l - } return n } @@ -2353,37 +2748,40 @@ func (m *Location) Size() (n int) { } var l int _ = l - if m.Id != 0 { - n += 1 + sovPprofextended(uint64(m.Id)) - } - if m.MappingIndex != 0 { - n += 1 + sovPprofextended(uint64(m.MappingIndex)) + if m.MappingIndex_ != nil { + n += m.MappingIndex_.Size() } if m.Address != 0 { - n += 1 + sovPprofextended(uint64(m.Address)) + n += 1 + sovProfiles(uint64(m.Address)) } if len(m.Line) > 0 { for _, e := range m.Line { l = e.Size() - n += 1 + l + sovPprofextended(uint64(l)) + n += 1 + l + sovProfiles(uint64(l)) } } if m.IsFolded { n += 2 } - if m.TypeIndex != 0 { - n += 1 + sovPprofextended(uint64(m.TypeIndex)) - } - if len(m.Attributes) > 0 { + if len(m.AttributeIndices) > 0 { l = 0 - for _, e := range m.Attributes { - l += sovPprofextended(uint64(e)) + for _, e := range m.AttributeIndices { + l += sovProfiles(uint64(e)) } - n += 1 + sovPprofextended(uint64(l)) + l + n += 1 + sovProfiles(uint64(l)) + l } return n } +func (m *Location_MappingIndex) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovProfiles(uint64(m.MappingIndex)) + return n +} func (m *Line) Size() (n int) { if m == nil { return 0 @@ -2391,13 +2789,13 @@ func (m *Line) Size() (n int) { var l int _ = l if m.FunctionIndex != 0 { - n += 1 + sovPprofextended(uint64(m.FunctionIndex)) + n += 1 + sovProfiles(uint64(m.FunctionIndex)) } if m.Line != 0 { - n += 1 + sovPprofextended(uint64(m.Line)) + n += 1 + sovProfiles(uint64(m.Line)) } if m.Column != 0 { - n += 1 + sovPprofextended(uint64(m.Column)) + n += 1 + sovProfiles(uint64(m.Column)) } return n } @@ -2408,31 +2806,28 @@ func (m *Function) Size() (n int) { } var l int _ = l - if m.Id != 0 { - n += 1 + sovPprofextended(uint64(m.Id)) - } - if m.Name != 0 { - n += 1 + sovPprofextended(uint64(m.Name)) + if m.NameStrindex != 0 { + n += 1 + sovProfiles(uint64(m.NameStrindex)) } - if m.SystemName != 0 { - n += 1 + sovPprofextended(uint64(m.SystemName)) + if m.SystemNameStrindex != 0 { + n += 1 + sovProfiles(uint64(m.SystemNameStrindex)) } - if m.Filename != 0 { - n += 1 + sovPprofextended(uint64(m.Filename)) + if m.FilenameStrindex != 0 { + n += 1 + sovProfiles(uint64(m.FilenameStrindex)) } if m.StartLine != 0 { - n += 1 + sovPprofextended(uint64(m.StartLine)) + n += 1 + sovProfiles(uint64(m.StartLine)) } return n } -func sovPprofextended(x uint64) (n int) { +func sovProfiles(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } -func sozPprofextended(x uint64) (n int) { - return sovPprofextended(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +func sozProfiles(x uint64) (n int) { + return sovProfiles(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *Profile) Unmarshal(dAtA []byte) error { +func (m *ProfilesData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2440,7 +2835,7 @@ func (m *Profile) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2455,20 +2850,20 @@ func (m *Profile) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Profile: wiretype end group for non-group") + return fmt.Errorf("proto: ProfilesData: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Profile: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ProfilesData: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SampleType", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ResourceProfiles", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2481,28 +2876,78 @@ func (m *Profile) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF } - m.SampleType = append(m.SampleType, &ValueType{}) - if err := m.SampleType[len(m.SampleType)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.ResourceProfiles = append(m.ResourceProfiles, &ResourceProfiles{}) + if err := m.ResourceProfiles[len(m.ResourceProfiles)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + default: + iNdEx = preIndex + skippy, err := skipProfiles(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProfiles + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResourceProfiles) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResourceProfiles: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResourceProfiles: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sample", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2515,28 +2960,27 @@ func (m *Profile) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF } - m.Sample = append(m.Sample, &Sample{}) - if err := m.Sample[len(m.Sample)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mapping", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ScopeProfiles", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2549,62 +2993,110 @@ func (m *Profile) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF } - m.Mapping = append(m.Mapping, &Mapping{}) - if err := m.Mapping[len(m.Mapping)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.ScopeProfiles = append(m.ScopeProfiles, &ScopeProfiles{}) + if err := m.ScopeProfiles[len(m.ScopeProfiles)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Location", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SchemaUrl", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthPprofextended + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProfiles } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF } - m.Location = append(m.Location, &Location{}) - if err := m.Location[len(m.Location)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.SchemaUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProfiles(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex - case 5: + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProfiles + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ScopeProfiles) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ScopeProfiles: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ScopeProfiles: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Function", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2617,136 +3109,211 @@ func (m *Profile) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF } - m.Function = append(m.Function, &Function{}) - if err := m.Function[len(m.Function)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Scope.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 6: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StringTable", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Profiles", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthPprofextended + if msglen < 0 { + return ErrInvalidLengthProfiles } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF } - m.StringTable = append(m.StringTable, string(dAtA[iNdEx:postIndex])) + m.Profiles = append(m.Profiles, &Profile{}) + if err := m.Profiles[len(m.Profiles)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DropFrames", wireType) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaUrl", wireType) } - m.DropFrames = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.DropFrames |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field KeepFrames", wireType) - } - m.KeepFrames = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPprofextended - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.KeepFrames |= int64(b&0x7F) << shift - if b < 0x80 { - break - } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProfiles } - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeNanos", wireType) + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProfiles } - m.TimeNanos = 0 + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SchemaUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProfiles(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProfiles + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Profile) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Profile: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Profile: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SampleType", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.TimeNanos |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationNanos", wireType) + if msglen < 0 { + return ErrInvalidLengthProfiles } - m.DurationNanos = 0 + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProfiles + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SampleType = append(m.SampleType, &ValueType{}) + if err := m.SampleType[len(m.SampleType)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sample", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.DurationNanos |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 11: + if msglen < 0 { + return ErrInvalidLengthProfiles + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProfiles + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sample = append(m.Sample, &Sample{}) + if err := m.Sample[len(m.Sample)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeriodType", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MappingTable", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2759,61 +3326,77 @@ func (m *Profile) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.PeriodType.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.MappingTable = append(m.MappingTable, &Mapping{}) + if err := m.MappingTable[len(m.MappingTable)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 12: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LocationTable", wireType) } - m.Period = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.Period |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 13: + if msglen < 0 { + return ErrInvalidLengthProfiles + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProfiles + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LocationTable = append(m.LocationTable, &Location{}) + if err := m.LocationTable[len(m.LocationTable)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: if wireType == 0 { - var v int64 + var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - v |= int64(b&0x7F) << shift + v |= int32(b&0x7F) << shift if b < 0x80 { break } } - m.Comment = append(m.Comment, v) + m.LocationIndices = append(m.LocationIndices, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2826,11 +3409,11 @@ func (m *Profile) Unmarshal(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF @@ -2843,72 +3426,311 @@ func (m *Profile) Unmarshal(dAtA []byte) error { } } elementCount = count - if elementCount != 0 && len(m.Comment) == 0 { - m.Comment = make([]int64, 0, elementCount) + if elementCount != 0 && len(m.LocationIndices) == 0 { + m.LocationIndices = make([]int32, 0, elementCount) } for iNdEx < postIndex { - var v int64 + var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - v |= int64(b&0x7F) << shift + v |= int32(b&0x7F) << shift if b < 0x80 { break } } - m.Comment = append(m.Comment, v) + m.LocationIndices = append(m.LocationIndices, v) } } else { - return fmt.Errorf("proto: wrong wireType = %d for field Comment", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LocationIndices", wireType) + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FunctionTable", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProfiles + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProfiles } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FunctionTable = append(m.FunctionTable, &Function{}) + if err := m.FunctionTable[len(m.FunctionTable)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AttributeTable", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProfiles + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProfiles + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AttributeTable = append(m.AttributeTable, v11.KeyValue{}) + if err := m.AttributeTable[len(m.AttributeTable)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AttributeUnits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProfiles + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProfiles + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AttributeUnits = append(m.AttributeUnits, &AttributeUnit{}) + if err := m.AttributeUnits[len(m.AttributeUnits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LinkTable", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProfiles + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProfiles + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LinkTable = append(m.LinkTable, &Link{}) + if err := m.LinkTable[len(m.LinkTable)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StringTable", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProfiles + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProfiles + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StringTable = append(m.StringTable, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeNanos", wireType) + } + m.TimeNanos = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeNanos |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DurationNanos", wireType) + } + m.DurationNanos = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DurationNanos |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeriodType", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProfiles + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProfiles + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PeriodType.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 14: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultSampleType", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) } - m.DefaultSampleType = 0 + m.Period = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.DefaultSampleType |= int64(b&0x7F) << shift + m.Period |= int64(b&0x7F) << shift if b < 0x80 { break } } case 15: if wireType == 0 { - var v int64 + var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - v |= int64(b&0x7F) << shift + v |= int32(b&0x7F) << shift if b < 0x80 { break } } - m.LocationIndices = append(m.LocationIndices, v) + m.CommentStrindices = append(m.CommentStrindices, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2921,11 +3743,11 @@ func (m *Profile) Unmarshal(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF @@ -2938,72 +3760,90 @@ func (m *Profile) Unmarshal(dAtA []byte) error { } } elementCount = count - if elementCount != 0 && len(m.LocationIndices) == 0 { - m.LocationIndices = make([]int64, 0, elementCount) + if elementCount != 0 && len(m.CommentStrindices) == 0 { + m.CommentStrindices = make([]int32, 0, elementCount) } for iNdEx < postIndex { - var v int64 + var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - v |= int64(b&0x7F) << shift + v |= int32(b&0x7F) << shift if b < 0x80 { break } } - m.LocationIndices = append(m.LocationIndices, v) + m.CommentStrindices = append(m.CommentStrindices, v) } } else { - return fmt.Errorf("proto: wrong wireType = %d for field LocationIndices", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CommentStrindices", wireType) } case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultSampleTypeStrindex", wireType) + } + m.DefaultSampleTypeStrindex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DefaultSampleTypeStrindex |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 17: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AttributeTable", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProfileId", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthPprofextended + if byteLen < 0 { + return ErrInvalidLengthProfiles } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF } - m.AttributeTable = append(m.AttributeTable, v1.KeyValue{}) - if err := m.AttributeTable[len(m.AttributeTable)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ProfileId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 17: + case 18: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AttributeUnits", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3016,62 +3856,113 @@ func (m *Profile) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF } - m.AttributeUnits = append(m.AttributeUnits, &AttributeUnit{}) - if err := m.AttributeUnits[len(m.AttributeUnits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Attributes = append(m.Attributes, v11.KeyValue{}) + if err := m.Attributes[len(m.Attributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 18: + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DroppedAttributesCount", wireType) + } + m.DroppedAttributesCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DroppedAttributesCount |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 20: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LinkTable", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OriginalPayloadFormat", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthPprofextended + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProfiles } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF } - m.LinkTable = append(m.LinkTable, &Link{}) - if err := m.LinkTable[len(m.LinkTable)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.OriginalPayloadFormat = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OriginalPayload", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthProfiles + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthProfiles + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OriginalPayload = append(m.OriginalPayload[:0], dAtA[iNdEx:postIndex]...) + if m.OriginalPayload == nil { + m.OriginalPayload = []byte{} } iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipPprofextended(dAtA[iNdEx:]) + skippy, err := skipProfiles(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3093,7 +3984,7 @@ func (m *AttributeUnit) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3116,50 +4007,50 @@ func (m *AttributeUnit) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AttributeKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AttributeKeyStrindex", wireType) } - m.AttributeKey = 0 + m.AttributeKeyStrindex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.AttributeKey |= int64(b&0x7F) << shift + m.AttributeKeyStrindex |= int32(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Unit", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UnitStrindex", wireType) } - m.Unit = 0 + m.UnitStrindex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.Unit |= int64(b&0x7F) << shift + m.UnitStrindex |= int32(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex - skippy, err := skipPprofextended(dAtA[iNdEx:]) + skippy, err := skipProfiles(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3181,7 +4072,7 @@ func (m *Link) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3209,7 +4100,7 @@ func (m *Link) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3222,11 +4113,11 @@ func (m *Link) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF @@ -3242,7 +4133,7 @@ func (m *Link) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3255,11 +4146,11 @@ func (m *Link) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF @@ -3270,12 +4161,12 @@ func (m *Link) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipPprofextended(dAtA[iNdEx:]) + skippy, err := skipProfiles(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3297,7 +4188,7 @@ func (m *ValueType) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3320,38 +4211,38 @@ func (m *ValueType) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TypeStrindex", wireType) } - m.Type = 0 + m.TypeStrindex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.Type |= int64(b&0x7F) << shift + m.TypeStrindex |= int32(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Unit", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UnitStrindex", wireType) } - m.Unit = 0 + m.UnitStrindex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.Unit |= int64(b&0x7F) << shift + m.UnitStrindex |= int32(b&0x7F) << shift if b < 0x80 { break } @@ -3363,7 +4254,7 @@ func (m *ValueType) Unmarshal(dAtA []byte) error { m.AggregationTemporality = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3377,12 +4268,12 @@ func (m *ValueType) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipPprofextended(dAtA[iNdEx:]) + skippy, err := skipProfiles(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3404,7 +4295,7 @@ func (m *Sample) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3426,87 +4317,49 @@ func (m *Sample) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPprofextended - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LocationsStartIndex", wireType) + } + m.LocationsStartIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles } - m.LocationIndex = append(m.LocationIndex, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPprofextended - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } + if iNdEx >= l { + return io.ErrUnexpectedEOF } - if packedLen < 0 { - return ErrInvalidLengthPprofextended + b := dAtA[iNdEx] + iNdEx++ + m.LocationsStartIndex |= int32(b&0x7F) << shift + if b < 0x80 { + break } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthPprofextended + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LocationsLength", wireType) + } + m.LocationsLength = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles } - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.LocationIndex) == 0 { - m.LocationIndex = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPprofextended - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.LocationIndex = append(m.LocationIndex, v) + b := dAtA[iNdEx] + iNdEx++ + m.LocationsLength |= int32(b&0x7F) << shift + if b < 0x80 { + break } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field LocationIndex", wireType) } - case 2: + case 3: if wireType == 0 { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3523,7 +4376,7 @@ func (m *Sample) Unmarshal(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3536,11 +4389,11 @@ func (m *Sample) Unmarshal(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF @@ -3560,137 +4413,46 @@ func (m *Sample) Unmarshal(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Value = append(m.Value, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPprofextended - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPprofextended - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPprofextended - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Label = append(m.Label, &Label{}) - if err := m.Label[len(m.Label)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LocationsStartIndex", wireType) - } - m.LocationsStartIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPprofextended - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LocationsStartIndex |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LocationsLength", wireType) - } - m.LocationsLength = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPprofextended - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LocationsLength |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StacktraceIdIndex", wireType) - } - m.StacktraceIdIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPprofextended - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StacktraceIdIndex |= uint32(b&0x7F) << shift - if b < 0x80 { - break + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Value = append(m.Value, v) } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } - case 10: + case 4: if wireType == 0 { - var v uint64 + var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - v |= uint64(b&0x7F) << shift + v |= int32(b&0x7F) << shift if b < 0x80 { break } } - m.Attributes = append(m.Attributes, v) + m.AttributeIndices = append(m.AttributeIndices, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3703,11 +4465,11 @@ func (m *Sample) Unmarshal(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF @@ -3720,55 +4482,56 @@ func (m *Sample) Unmarshal(dAtA []byte) error { } } elementCount = count - if elementCount != 0 && len(m.Attributes) == 0 { - m.Attributes = make([]uint64, 0, elementCount) + if elementCount != 0 && len(m.AttributeIndices) == 0 { + m.AttributeIndices = make([]int32, 0, elementCount) } for iNdEx < postIndex { - var v uint64 + var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - v |= uint64(b&0x7F) << shift + v |= int32(b&0x7F) << shift if b < 0x80 { break } } - m.Attributes = append(m.Attributes, v) + m.AttributeIndices = append(m.AttributeIndices, v) } } else { - return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AttributeIndices", wireType) } - case 12: + case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Link", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LinkIndex", wireType) } - m.Link = 0 + var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.Link |= uint64(b&0x7F) << shift + v |= int32(b&0x7F) << shift if b < 0x80 { break } } - case 13: + m.LinkIndex_ = &Sample_LinkIndex{v} + case 6: if wireType == 0 { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3785,7 +4548,7 @@ func (m *Sample) Unmarshal(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3798,11 +4561,11 @@ func (m *Sample) Unmarshal(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF @@ -3822,7 +4585,7 @@ func (m *Sample) Unmarshal(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3841,12 +4604,12 @@ func (m *Sample) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipPprofextended(dAtA[iNdEx:]) + skippy, err := skipProfiles(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3868,7 +4631,7 @@ func (m *Label) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3891,38 +4654,38 @@ func (m *Label) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field KeyStrindex", wireType) } - m.Key = 0 + m.KeyStrindex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.Key |= int64(b&0x7F) << shift + m.KeyStrindex |= int32(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Str", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StrStrindex", wireType) } - m.Str = 0 + m.StrStrindex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.Str |= int64(b&0x7F) << shift + m.StrStrindex |= int32(b&0x7F) << shift if b < 0x80 { break } @@ -3934,7 +4697,7 @@ func (m *Label) Unmarshal(dAtA []byte) error { m.Num = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3948,31 +4711,31 @@ func (m *Label) Unmarshal(dAtA []byte) error { } case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumUnit", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NumUnitStrindex", wireType) } - m.NumUnit = 0 + m.NumUnitStrindex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.NumUnit |= int64(b&0x7F) << shift + m.NumUnitStrindex |= int32(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex - skippy, err := skipPprofextended(dAtA[iNdEx:]) + skippy, err := skipProfiles(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3994,7 +4757,7 @@ func (m *Mapping) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4016,32 +4779,13 @@ func (m *Mapping) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPprofextended - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MemoryStart", wireType) } m.MemoryStart = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4053,14 +4797,14 @@ func (m *Mapping) Unmarshal(dAtA []byte) error { break } } - case 3: + case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MemoryLimit", wireType) } m.MemoryLimit = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4072,14 +4816,14 @@ func (m *Mapping) Unmarshal(dAtA []byte) error { break } } - case 4: + case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field FileOffset", wireType) } m.FileOffset = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4091,52 +4835,109 @@ func (m *Mapping) Unmarshal(dAtA []byte) error { break } } - case 5: + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Filename", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FilenameStrindex", wireType) } - m.Filename = 0 + m.FilenameStrindex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.Filename |= int64(b&0x7F) << shift + m.FilenameStrindex |= int32(b&0x7F) << shift if b < 0x80 { break } } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BuildId", wireType) - } - m.BuildId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPprofextended + case 5: + if wireType == 0 { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } } - if iNdEx >= l { + m.AttributeIndices = append(m.AttributeIndices, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthProfiles + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthProfiles + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - m.BuildId |= int64(b&0x7F) << shift - if b < 0x80 { - break + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.AttributeIndices) == 0 { + m.AttributeIndices = make([]int32, 0, elementCount) + } + for iNdEx < postIndex { + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProfiles + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AttributeIndices = append(m.AttributeIndices, v) } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field AttributeIndices", wireType) } - case 7: + case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field HasFunctions", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4149,14 +4950,14 @@ func (m *Mapping) Unmarshal(dAtA []byte) error { } } m.HasFunctions = bool(v != 0) - case 8: + case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field HasFilenames", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4169,14 +4970,14 @@ func (m *Mapping) Unmarshal(dAtA []byte) error { } } m.HasFilenames = bool(v != 0) - case 9: + case 8: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field HasLineNumbers", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4189,14 +4990,14 @@ func (m *Mapping) Unmarshal(dAtA []byte) error { } } m.HasLineNumbers = bool(v != 0) - case 10: + case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field HasInlineFrames", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4209,109 +5010,14 @@ func (m *Mapping) Unmarshal(dAtA []byte) error { } } m.HasInlineFrames = bool(v != 0) - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BuildIdKind", wireType) - } - m.BuildIdKind = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPprofextended - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BuildIdKind |= BuildIdKind(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPprofextended - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Attributes = append(m.Attributes, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPprofextended - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthPprofextended - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthPprofextended - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.Attributes) == 0 { - m.Attributes = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPprofextended - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Attributes = append(m.Attributes, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) - } default: iNdEx = preIndex - skippy, err := skipPprofextended(dAtA[iNdEx:]) + skippy, err := skipProfiles(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4333,7 +5039,7 @@ func (m *Location) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4355,51 +5061,33 @@ func (m *Location) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPprofextended - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MappingIndex", wireType) } - m.MappingIndex = 0 + var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.MappingIndex |= uint64(b&0x7F) << shift + v |= int32(b&0x7F) << shift if b < 0x80 { break } } - case 3: + m.MappingIndex_ = &Location_MappingIndex{v} + case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } m.Address = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4411,14 +5099,14 @@ func (m *Location) Unmarshal(dAtA []byte) error { break } } - case 4: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Line", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4431,11 +5119,11 @@ func (m *Location) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF @@ -4445,14 +5133,14 @@ func (m *Location) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field IsFolded", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4465,48 +5153,29 @@ func (m *Location) Unmarshal(dAtA []byte) error { } } m.IsFolded = bool(v != 0) - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TypeIndex", wireType) - } - m.TypeIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPprofextended - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TypeIndex |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: + case 5: if wireType == 0 { - var v uint64 + var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - v |= uint64(b&0x7F) << shift + v |= int32(b&0x7F) << shift if b < 0x80 { break } } - m.Attributes = append(m.Attributes, v) + m.AttributeIndices = append(m.AttributeIndices, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4519,11 +5188,11 @@ func (m *Location) Unmarshal(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if postIndex > l { return io.ErrUnexpectedEOF @@ -4536,38 +5205,38 @@ func (m *Location) Unmarshal(dAtA []byte) error { } } elementCount = count - if elementCount != 0 && len(m.Attributes) == 0 { - m.Attributes = make([]uint64, 0, elementCount) + if elementCount != 0 && len(m.AttributeIndices) == 0 { + m.AttributeIndices = make([]int32, 0, elementCount) } for iNdEx < postIndex { - var v uint64 + var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - v |= uint64(b&0x7F) << shift + v |= int32(b&0x7F) << shift if b < 0x80 { break } } - m.Attributes = append(m.Attributes, v) + m.AttributeIndices = append(m.AttributeIndices, v) } } else { - return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AttributeIndices", wireType) } default: iNdEx = preIndex - skippy, err := skipPprofextended(dAtA[iNdEx:]) + skippy, err := skipProfiles(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4589,7 +5258,7 @@ func (m *Line) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4617,14 +5286,14 @@ func (m *Line) Unmarshal(dAtA []byte) error { m.FunctionIndex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.FunctionIndex |= uint64(b&0x7F) << shift + m.FunctionIndex |= int32(b&0x7F) << shift if b < 0x80 { break } @@ -4636,7 +5305,7 @@ func (m *Line) Unmarshal(dAtA []byte) error { m.Line = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4655,7 +5324,7 @@ func (m *Line) Unmarshal(dAtA []byte) error { m.Column = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4669,12 +5338,12 @@ func (m *Line) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipPprofextended(dAtA[iNdEx:]) + skippy, err := skipProfiles(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4696,7 +5365,7 @@ func (m *Function) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4719,88 +5388,69 @@ func (m *Function) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NameStrindex", wireType) } - m.Id = 0 + m.NameStrindex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.Id |= uint64(b&0x7F) << shift + m.NameStrindex |= int32(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SystemNameStrindex", wireType) } - m.Name = 0 + m.SystemNameStrindex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.Name |= int64(b&0x7F) << shift + m.SystemNameStrindex |= int32(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SystemName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FilenameStrindex", wireType) } - m.SystemName = 0 + m.FilenameStrindex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ - m.SystemName |= int64(b&0x7F) << shift + m.FilenameStrindex |= int32(b&0x7F) << shift if b < 0x80 { break } } case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Filename", wireType) - } - m.Filename = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPprofextended - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Filename |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field StartLine", wireType) } m.StartLine = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowPprofextended + return ErrIntOverflowProfiles } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4814,12 +5464,12 @@ func (m *Function) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipPprofextended(dAtA[iNdEx:]) + skippy, err := skipProfiles(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPprofextended + return ErrInvalidLengthProfiles } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4833,7 +5483,7 @@ func (m *Function) Unmarshal(dAtA []byte) error { } return nil } -func skipPprofextended(dAtA []byte) (n int, err error) { +func skipProfiles(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 @@ -4841,7 +5491,7 @@ func skipPprofextended(dAtA []byte) (n int, err error) { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowPprofextended + return 0, ErrIntOverflowProfiles } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -4858,7 +5508,7 @@ func skipPprofextended(dAtA []byte) (n int, err error) { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowPprofextended + return 0, ErrIntOverflowProfiles } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -4874,7 +5524,7 @@ func skipPprofextended(dAtA []byte) (n int, err error) { var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowPprofextended + return 0, ErrIntOverflowProfiles } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -4887,14 +5537,14 @@ func skipPprofextended(dAtA []byte) (n int, err error) { } } if length < 0 { - return 0, ErrInvalidLengthPprofextended + return 0, ErrInvalidLengthProfiles } iNdEx += length case 3: depth++ case 4: if depth == 0 { - return 0, ErrUnexpectedEndOfGroupPprofextended + return 0, ErrUnexpectedEndOfGroupProfiles } depth-- case 5: @@ -4903,7 +5553,7 @@ func skipPprofextended(dAtA []byte) (n int, err error) { return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { - return 0, ErrInvalidLengthPprofextended + return 0, ErrInvalidLengthProfiles } if depth == 0 { return iNdEx, nil @@ -4913,7 +5563,7 @@ func skipPprofextended(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthPprofextended = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPprofextended = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupPprofextended = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthProfiles = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowProfiles = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupProfiles = fmt.Errorf("proto: unexpected end of group") ) diff --git a/pdata/internal/data/protogen/profiles/v1experimental/profiles.pb.go b/pdata/internal/data/protogen/profiles/v1experimental/profiles.pb.go deleted file mode 100644 index cd1c215adb4..00000000000 --- a/pdata/internal/data/protogen/profiles/v1experimental/profiles.pb.go +++ /dev/null @@ -1,1477 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: opentelemetry/proto/profiles/v1experimental/profiles.proto - -package v1experimental - -import ( - encoding_binary "encoding/binary" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - - go_opentelemetry_io_collector_pdata_internal_data "go.opentelemetry.io/collector/pdata/internal/data" - v11 "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" - v1 "go.opentelemetry.io/collector/pdata/internal/data/protogen/resource/v1" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// ProfilesData represents the profiles data that can be stored in persistent storage, -// OR can be embedded by other protocols that transfer OTLP profiles data but do not -// implement the OTLP protocol. -// -// The main difference between this message and collector protocol is that -// in this message there will not be any "control" or "metadata" specific to -// OTLP protocol. -// -// When new fields are added into this message, the OTLP request MUST be updated -// as well. -type ProfilesData struct { - // An array of ResourceProfiles. - // For data coming from a single resource this array will typically contain - // one element. Intermediary nodes that receive data from multiple origins - // typically batch the data before forwarding further and in that case this - // array will contain multiple elements. - ResourceProfiles []*ResourceProfiles `protobuf:"bytes,1,rep,name=resource_profiles,json=resourceProfiles,proto3" json:"resource_profiles,omitempty"` -} - -func (m *ProfilesData) Reset() { *m = ProfilesData{} } -func (m *ProfilesData) String() string { return proto.CompactTextString(m) } -func (*ProfilesData) ProtoMessage() {} -func (*ProfilesData) Descriptor() ([]byte, []int) { - return fileDescriptor_394731f2296acea3, []int{0} -} -func (m *ProfilesData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProfilesData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProfilesData.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ProfilesData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProfilesData.Merge(m, src) -} -func (m *ProfilesData) XXX_Size() int { - return m.Size() -} -func (m *ProfilesData) XXX_DiscardUnknown() { - xxx_messageInfo_ProfilesData.DiscardUnknown(m) -} - -var xxx_messageInfo_ProfilesData proto.InternalMessageInfo - -func (m *ProfilesData) GetResourceProfiles() []*ResourceProfiles { - if m != nil { - return m.ResourceProfiles - } - return nil -} - -// A collection of ScopeProfiles from a Resource. -type ResourceProfiles struct { - // The resource for the profiles in this message. - // If this field is not set then no resource info is known. - Resource v1.Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource"` - // A list of ScopeProfiles that originate from a resource. - ScopeProfiles []*ScopeProfiles `protobuf:"bytes,2,rep,name=scope_profiles,json=scopeProfiles,proto3" json:"scope_profiles,omitempty"` - // The Schema URL, if known. This is the identifier of the Schema that the resource data - // is recorded in. To learn more about Schema URL see - // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url - // This schema_url applies to the data in the "resource" field. It does not apply - // to the data in the "scope_profiles" field which have their own schema_url field. - SchemaUrl string `protobuf:"bytes,3,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"` -} - -func (m *ResourceProfiles) Reset() { *m = ResourceProfiles{} } -func (m *ResourceProfiles) String() string { return proto.CompactTextString(m) } -func (*ResourceProfiles) ProtoMessage() {} -func (*ResourceProfiles) Descriptor() ([]byte, []int) { - return fileDescriptor_394731f2296acea3, []int{1} -} -func (m *ResourceProfiles) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResourceProfiles) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ResourceProfiles.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ResourceProfiles) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourceProfiles.Merge(m, src) -} -func (m *ResourceProfiles) XXX_Size() int { - return m.Size() -} -func (m *ResourceProfiles) XXX_DiscardUnknown() { - xxx_messageInfo_ResourceProfiles.DiscardUnknown(m) -} - -var xxx_messageInfo_ResourceProfiles proto.InternalMessageInfo - -func (m *ResourceProfiles) GetResource() v1.Resource { - if m != nil { - return m.Resource - } - return v1.Resource{} -} - -func (m *ResourceProfiles) GetScopeProfiles() []*ScopeProfiles { - if m != nil { - return m.ScopeProfiles - } - return nil -} - -func (m *ResourceProfiles) GetSchemaUrl() string { - if m != nil { - return m.SchemaUrl - } - return "" -} - -// A collection of ProfileContainers produced by an InstrumentationScope. -type ScopeProfiles struct { - // The instrumentation scope information for the profiles in this message. - // Semantically when InstrumentationScope isn't set, it is equivalent with - // an empty instrumentation scope name (unknown). - Scope v11.InstrumentationScope `protobuf:"bytes,1,opt,name=scope,proto3" json:"scope"` - // A list of ProfileContainers that originate from an instrumentation scope. - Profiles []*ProfileContainer `protobuf:"bytes,2,rep,name=profiles,proto3" json:"profiles,omitempty"` - // The Schema URL, if known. This is the identifier of the Schema that the metric data - // is recorded in. To learn more about Schema URL see - // https://opentelemetry.io/docs/specs/otel/schemas/#schema-url - // This schema_url applies to all profiles in the "profiles" field. - SchemaUrl string `protobuf:"bytes,3,opt,name=schema_url,json=schemaUrl,proto3" json:"schema_url,omitempty"` -} - -func (m *ScopeProfiles) Reset() { *m = ScopeProfiles{} } -func (m *ScopeProfiles) String() string { return proto.CompactTextString(m) } -func (*ScopeProfiles) ProtoMessage() {} -func (*ScopeProfiles) Descriptor() ([]byte, []int) { - return fileDescriptor_394731f2296acea3, []int{2} -} -func (m *ScopeProfiles) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ScopeProfiles) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ScopeProfiles.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ScopeProfiles) XXX_Merge(src proto.Message) { - xxx_messageInfo_ScopeProfiles.Merge(m, src) -} -func (m *ScopeProfiles) XXX_Size() int { - return m.Size() -} -func (m *ScopeProfiles) XXX_DiscardUnknown() { - xxx_messageInfo_ScopeProfiles.DiscardUnknown(m) -} - -var xxx_messageInfo_ScopeProfiles proto.InternalMessageInfo - -func (m *ScopeProfiles) GetScope() v11.InstrumentationScope { - if m != nil { - return m.Scope - } - return v11.InstrumentationScope{} -} - -func (m *ScopeProfiles) GetProfiles() []*ProfileContainer { - if m != nil { - return m.Profiles - } - return nil -} - -func (m *ScopeProfiles) GetSchemaUrl() string { - if m != nil { - return m.SchemaUrl - } - return "" -} - -// A ProfileContainer represents a single profile. It wraps pprof profile with OpenTelemetry specific metadata. -type ProfileContainer struct { - // A globally unique identifier for a profile. The ID is a 16-byte array. An ID with - // all zeroes is considered invalid. - // - // This field is required. - ProfileId go_opentelemetry_io_collector_pdata_internal_data.ProfileID `protobuf:"bytes,1,opt,name=profile_id,json=profileId,proto3,customtype=go.opentelemetry.io/collector/pdata/internal/data.ProfileID" json:"profile_id"` - // start_time_unix_nano is the start time of the profile. - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. - // - // This field is semantically required and it is expected that end_time >= start_time. - StartTimeUnixNano uint64 `protobuf:"fixed64,2,opt,name=start_time_unix_nano,json=startTimeUnixNano,proto3" json:"start_time_unix_nano,omitempty"` - // end_time_unix_nano is the end time of the profile. - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. - // - // This field is semantically required and it is expected that end_time >= start_time. - EndTimeUnixNano uint64 `protobuf:"fixed64,3,opt,name=end_time_unix_nano,json=endTimeUnixNano,proto3" json:"end_time_unix_nano,omitempty"` - // attributes is a collection of key/value pairs. Note, global attributes - // like server name can be set using the resource API. Examples of attributes: - // - // "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" - // "/http/server_latency": 300 - // "abc.com/myattribute": true - // "abc.com/score": 10.239 - // - // The OpenTelemetry API specification further restricts the allowed value types: - // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute - // Attribute keys MUST be unique (it is not allowed to have more than one - // attribute with the same key). - Attributes []v11.KeyValue `protobuf:"bytes,4,rep,name=attributes,proto3" json:"attributes"` - // dropped_attributes_count is the number of attributes that were discarded. Attributes - // can be discarded because their keys are too long or because there are too many - // attributes. If this value is 0, then no attributes were dropped. - DroppedAttributesCount uint32 `protobuf:"varint,5,opt,name=dropped_attributes_count,json=droppedAttributesCount,proto3" json:"dropped_attributes_count,omitempty"` - // Specifies format of the original payload. Common values are defined in semantic conventions. [required if original_payload is present] - OriginalPayloadFormat string `protobuf:"bytes,6,opt,name=original_payload_format,json=originalPayloadFormat,proto3" json:"original_payload_format,omitempty"` - // Original payload can be stored in this field. This can be useful for users who want to get the original payload. - // Formats such as JFR are highly extensible and can contain more information than what is defined in this spec. - // Inclusion of original payload should be configurable by the user. Default behavior should be to not include the original payload. - // If the original payload is in pprof format, it SHOULD not be included in this field. - // The field is optional, however if it is present `profile` MUST be present and contain the same profiling information. - OriginalPayload []byte `protobuf:"bytes,7,opt,name=original_payload,json=originalPayload,proto3" json:"original_payload,omitempty"` - // This is a reference to a pprof profile. Required, even when original_payload is present. - Profile Profile `protobuf:"bytes,8,opt,name=profile,proto3" json:"profile"` -} - -func (m *ProfileContainer) Reset() { *m = ProfileContainer{} } -func (m *ProfileContainer) String() string { return proto.CompactTextString(m) } -func (*ProfileContainer) ProtoMessage() {} -func (*ProfileContainer) Descriptor() ([]byte, []int) { - return fileDescriptor_394731f2296acea3, []int{3} -} -func (m *ProfileContainer) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProfileContainer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProfileContainer.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ProfileContainer) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProfileContainer.Merge(m, src) -} -func (m *ProfileContainer) XXX_Size() int { - return m.Size() -} -func (m *ProfileContainer) XXX_DiscardUnknown() { - xxx_messageInfo_ProfileContainer.DiscardUnknown(m) -} - -var xxx_messageInfo_ProfileContainer proto.InternalMessageInfo - -func (m *ProfileContainer) GetStartTimeUnixNano() uint64 { - if m != nil { - return m.StartTimeUnixNano - } - return 0 -} - -func (m *ProfileContainer) GetEndTimeUnixNano() uint64 { - if m != nil { - return m.EndTimeUnixNano - } - return 0 -} - -func (m *ProfileContainer) GetAttributes() []v11.KeyValue { - if m != nil { - return m.Attributes - } - return nil -} - -func (m *ProfileContainer) GetDroppedAttributesCount() uint32 { - if m != nil { - return m.DroppedAttributesCount - } - return 0 -} - -func (m *ProfileContainer) GetOriginalPayloadFormat() string { - if m != nil { - return m.OriginalPayloadFormat - } - return "" -} - -func (m *ProfileContainer) GetOriginalPayload() []byte { - if m != nil { - return m.OriginalPayload - } - return nil -} - -func (m *ProfileContainer) GetProfile() Profile { - if m != nil { - return m.Profile - } - return Profile{} -} - -func init() { - proto.RegisterType((*ProfilesData)(nil), "opentelemetry.proto.profiles.v1experimental.ProfilesData") - proto.RegisterType((*ResourceProfiles)(nil), "opentelemetry.proto.profiles.v1experimental.ResourceProfiles") - proto.RegisterType((*ScopeProfiles)(nil), "opentelemetry.proto.profiles.v1experimental.ScopeProfiles") - proto.RegisterType((*ProfileContainer)(nil), "opentelemetry.proto.profiles.v1experimental.ProfileContainer") -} - -func init() { - proto.RegisterFile("opentelemetry/proto/profiles/v1experimental/profiles.proto", fileDescriptor_394731f2296acea3) -} - -var fileDescriptor_394731f2296acea3 = []byte{ - // 671 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xdf, 0x6e, 0xd3, 0x30, - 0x14, 0xc6, 0xeb, 0xfd, 0x69, 0x3b, 0x6f, 0x65, 0x9d, 0x35, 0x20, 0x9a, 0x44, 0x57, 0xf5, 0x86, - 0x8e, 0x49, 0x89, 0xba, 0x21, 0x84, 0x86, 0x10, 0xa2, 0x1b, 0x48, 0x63, 0x82, 0x55, 0x61, 0x9b, - 0x04, 0x37, 0x91, 0xd7, 0x78, 0xc5, 0x28, 0xb1, 0x23, 0xc7, 0xa9, 0x3a, 0x9e, 0x82, 0x2b, 0x1e, - 0x82, 0x27, 0xd9, 0xe5, 0x2e, 0xd1, 0x90, 0x26, 0xb4, 0xdd, 0xb0, 0xb7, 0x40, 0x71, 0x9c, 0xd0, - 0x46, 0x45, 0x53, 0xb9, 0x89, 0x1c, 0x9f, 0xef, 0xfc, 0xce, 0xf9, 0x7c, 0x9c, 0xc0, 0x2d, 0x1e, - 0x10, 0x26, 0x89, 0x47, 0x7c, 0x22, 0xc5, 0xa9, 0x15, 0x08, 0x2e, 0x79, 0xfc, 0x3c, 0xa1, 0x1e, - 0x09, 0xad, 0x7e, 0x8b, 0x0c, 0x02, 0x22, 0xa8, 0x4f, 0x98, 0xc4, 0x5e, 0xb6, 0x6f, 0x2a, 0x19, - 0x5a, 0x1f, 0xc9, 0x4d, 0x36, 0xcd, 0x4c, 0x33, 0x9a, 0xbb, 0xb2, 0xdc, 0xe3, 0x3d, 0x9e, 0xe0, - 0xe3, 0x55, 0xa2, 0x5e, 0x79, 0x34, 0xae, 0x7c, 0x97, 0xfb, 0x3e, 0x67, 0x56, 0xbf, 0xa5, 0x57, - 0x5a, 0x6b, 0x8e, 0xd3, 0x0a, 0x12, 0xf2, 0x48, 0x74, 0x49, 0xac, 0x4e, 0xd7, 0x5a, 0xff, 0x62, - 0x22, 0x6b, 0x71, 0x80, 0x0c, 0x24, 0x61, 0x2e, 0x71, 0x13, 0x40, 0xe3, 0x0b, 0x5c, 0xe8, 0x68, - 0xf9, 0x0e, 0x96, 0x18, 0x7d, 0x86, 0x4b, 0x69, 0x09, 0x27, 0xe5, 0x18, 0xa0, 0x3e, 0xdd, 0x9c, - 0xdf, 0x78, 0x6e, 0x4e, 0x70, 0x16, 0xa6, 0xad, 0x29, 0x29, 0xdd, 0xae, 0x8a, 0xdc, 0x4e, 0xe3, - 0x06, 0xc0, 0x6a, 0x5e, 0x86, 0xf6, 0x60, 0x39, 0x15, 0x1a, 0xa0, 0x0e, 0x9a, 0xf3, 0x1b, 0x6b, - 0x63, 0xeb, 0x66, 0x07, 0xd1, 0x6f, 0x65, 0xb5, 0xda, 0x33, 0x67, 0x97, 0xab, 0x05, 0x3b, 0x03, - 0x20, 0x0c, 0xef, 0x84, 0x5d, 0x1e, 0x0c, 0x59, 0x99, 0x52, 0x56, 0xb6, 0x26, 0xb2, 0xf2, 0x3e, - 0x46, 0x64, 0x3e, 0x2a, 0xe1, 0xf0, 0x2b, 0x7a, 0x00, 0x61, 0xd8, 0xfd, 0x44, 0x7c, 0xec, 0x44, - 0xc2, 0x33, 0xa6, 0xeb, 0xa0, 0x39, 0x67, 0xcf, 0x25, 0x3b, 0x87, 0xc2, 0x7b, 0x53, 0x2c, 0xff, - 0x2e, 0x55, 0x6f, 0x4a, 0x8d, 0x0b, 0x00, 0x2b, 0x23, 0x1c, 0xb4, 0x0f, 0x67, 0x15, 0x49, 0xbb, - 0xdc, 0x1c, 0xdb, 0x92, 0xbe, 0x1c, 0xfd, 0x96, 0xb9, 0xcb, 0x42, 0x29, 0x22, 0xd5, 0x91, 0xa4, - 0x9c, 0x29, 0x96, 0xf6, 0x9b, 0x70, 0xd0, 0x07, 0x58, 0xce, 0xd9, 0x9c, 0x6c, 0x62, 0xba, 0xb3, - 0x6d, 0xce, 0x24, 0xa6, 0x8c, 0x08, 0x3b, 0xc3, 0xdd, 0x62, 0xb2, 0xf1, 0x6d, 0x06, 0x56, 0xf3, - 0xd9, 0xe8, 0x18, 0x42, 0x9d, 0xef, 0x50, 0x57, 0x99, 0x5c, 0x68, 0x6f, 0xc7, 0xfd, 0x5e, 0x5c, - 0xae, 0x3e, 0xeb, 0xf1, 0x5c, 0x6b, 0x34, 0xfe, 0x24, 0x3c, 0x8f, 0x74, 0x25, 0x17, 0x56, 0xe0, - 0x62, 0x89, 0x2d, 0xca, 0x24, 0x11, 0x0c, 0x7b, 0x56, 0xfc, 0x96, 0x76, 0xb7, 0xbb, 0x63, 0xcf, - 0x69, 0xec, 0xae, 0x8b, 0x2c, 0xb8, 0x1c, 0x4a, 0x2c, 0xa4, 0x23, 0xa9, 0x4f, 0x9c, 0x88, 0xd1, - 0x81, 0xc3, 0x30, 0xe3, 0xc6, 0x54, 0x1d, 0x34, 0x8b, 0xf6, 0x92, 0x8a, 0x1d, 0x50, 0x9f, 0x1c, - 0x32, 0x3a, 0x78, 0x87, 0x19, 0x47, 0xeb, 0x10, 0x11, 0xe6, 0xe6, 0xe5, 0xd3, 0x4a, 0xbe, 0x48, - 0x98, 0x3b, 0x22, 0x7e, 0x0b, 0x21, 0x96, 0x52, 0xd0, 0xe3, 0x48, 0x92, 0xd0, 0x98, 0x51, 0x47, - 0xfa, 0xf0, 0x96, 0x31, 0xed, 0x91, 0xd3, 0x23, 0xec, 0x45, 0xe9, 0x68, 0x86, 0x00, 0xe8, 0x29, - 0x34, 0x5c, 0xc1, 0x83, 0x80, 0xb8, 0xce, 0xdf, 0x5d, 0xa7, 0xcb, 0x23, 0x26, 0x8d, 0xd9, 0x3a, - 0x68, 0x56, 0xec, 0x7b, 0x3a, 0xfe, 0x32, 0x0b, 0x6f, 0xc7, 0x51, 0xf4, 0x04, 0xde, 0xe7, 0x82, - 0xf6, 0x28, 0xc3, 0x9e, 0x13, 0xe0, 0x53, 0x8f, 0x63, 0xd7, 0x39, 0xe1, 0xc2, 0xc7, 0xd2, 0x28, - 0xaa, 0x59, 0xdc, 0x4d, 0xc3, 0x9d, 0x24, 0xfa, 0x5a, 0x05, 0xd1, 0x1a, 0xac, 0xe6, 0xf3, 0x8c, - 0x52, 0x3c, 0x08, 0x7b, 0x31, 0x97, 0x80, 0x0e, 0x60, 0x49, 0x1f, 0xab, 0x51, 0x56, 0xf7, 0xf1, - 0xf1, 0xff, 0xdc, 0x1d, 0xed, 0x3a, 0x45, 0xb5, 0x7f, 0x82, 0xb3, 0xab, 0x1a, 0x38, 0xbf, 0xaa, - 0x81, 0x5f, 0x57, 0x35, 0xf0, 0xf5, 0xba, 0x56, 0x38, 0xbf, 0xae, 0x15, 0x7e, 0x5c, 0xd7, 0x0a, - 0xd0, 0xa4, 0x7c, 0x92, 0x0a, 0xed, 0x4a, 0xfa, 0xe1, 0x74, 0x62, 0x59, 0x07, 0x7c, 0xb4, 0x27, - 0xbe, 0x43, 0xc9, 0xef, 0xb1, 0x47, 0xd8, 0xbf, 0xfe, 0x90, 0xdf, 0xa7, 0xd6, 0xf7, 0x03, 0xc2, - 0x0e, 0x32, 0xa2, 0xaa, 0x95, 0x9a, 0x0b, 0xcd, 0xa3, 0xd6, 0xab, 0x21, 0xf5, 0x71, 0x51, 0xf1, - 0x36, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x73, 0x8f, 0x2e, 0xdd, 0x60, 0x06, 0x00, 0x00, -} - -func (m *ProfilesData) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProfilesData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProfilesData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ResourceProfiles) > 0 { - for iNdEx := len(m.ResourceProfiles) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ResourceProfiles[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProfiles(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ResourceProfiles) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ResourceProfiles) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResourceProfiles) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SchemaUrl) > 0 { - i -= len(m.SchemaUrl) - copy(dAtA[i:], m.SchemaUrl) - i = encodeVarintProfiles(dAtA, i, uint64(len(m.SchemaUrl))) - i-- - dAtA[i] = 0x1a - } - if len(m.ScopeProfiles) > 0 { - for iNdEx := len(m.ScopeProfiles) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ScopeProfiles[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProfiles(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProfiles(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ScopeProfiles) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ScopeProfiles) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ScopeProfiles) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SchemaUrl) > 0 { - i -= len(m.SchemaUrl) - copy(dAtA[i:], m.SchemaUrl) - i = encodeVarintProfiles(dAtA, i, uint64(len(m.SchemaUrl))) - i-- - dAtA[i] = 0x1a - } - if len(m.Profiles) > 0 { - for iNdEx := len(m.Profiles) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Profiles[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProfiles(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.Scope.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProfiles(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ProfileContainer) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProfileContainer) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProfileContainer) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Profile.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProfiles(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - if len(m.OriginalPayload) > 0 { - i -= len(m.OriginalPayload) - copy(dAtA[i:], m.OriginalPayload) - i = encodeVarintProfiles(dAtA, i, uint64(len(m.OriginalPayload))) - i-- - dAtA[i] = 0x3a - } - if len(m.OriginalPayloadFormat) > 0 { - i -= len(m.OriginalPayloadFormat) - copy(dAtA[i:], m.OriginalPayloadFormat) - i = encodeVarintProfiles(dAtA, i, uint64(len(m.OriginalPayloadFormat))) - i-- - dAtA[i] = 0x32 - } - if m.DroppedAttributesCount != 0 { - i = encodeVarintProfiles(dAtA, i, uint64(m.DroppedAttributesCount)) - i-- - dAtA[i] = 0x28 - } - if len(m.Attributes) > 0 { - for iNdEx := len(m.Attributes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Attributes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProfiles(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.EndTimeUnixNano != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.EndTimeUnixNano)) - i-- - dAtA[i] = 0x19 - } - if m.StartTimeUnixNano != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.StartTimeUnixNano)) - i-- - dAtA[i] = 0x11 - } - { - size := m.ProfileId.Size() - i -= size - if _, err := m.ProfileId.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintProfiles(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintProfiles(dAtA []byte, offset int, v uint64) int { - offset -= sovProfiles(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ProfilesData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ResourceProfiles) > 0 { - for _, e := range m.ResourceProfiles { - l = e.Size() - n += 1 + l + sovProfiles(uint64(l)) - } - } - return n -} - -func (m *ResourceProfiles) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Resource.Size() - n += 1 + l + sovProfiles(uint64(l)) - if len(m.ScopeProfiles) > 0 { - for _, e := range m.ScopeProfiles { - l = e.Size() - n += 1 + l + sovProfiles(uint64(l)) - } - } - l = len(m.SchemaUrl) - if l > 0 { - n += 1 + l + sovProfiles(uint64(l)) - } - return n -} - -func (m *ScopeProfiles) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Scope.Size() - n += 1 + l + sovProfiles(uint64(l)) - if len(m.Profiles) > 0 { - for _, e := range m.Profiles { - l = e.Size() - n += 1 + l + sovProfiles(uint64(l)) - } - } - l = len(m.SchemaUrl) - if l > 0 { - n += 1 + l + sovProfiles(uint64(l)) - } - return n -} - -func (m *ProfileContainer) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ProfileId.Size() - n += 1 + l + sovProfiles(uint64(l)) - if m.StartTimeUnixNano != 0 { - n += 9 - } - if m.EndTimeUnixNano != 0 { - n += 9 - } - if len(m.Attributes) > 0 { - for _, e := range m.Attributes { - l = e.Size() - n += 1 + l + sovProfiles(uint64(l)) - } - } - if m.DroppedAttributesCount != 0 { - n += 1 + sovProfiles(uint64(m.DroppedAttributesCount)) - } - l = len(m.OriginalPayloadFormat) - if l > 0 { - n += 1 + l + sovProfiles(uint64(l)) - } - l = len(m.OriginalPayload) - if l > 0 { - n += 1 + l + sovProfiles(uint64(l)) - } - l = m.Profile.Size() - n += 1 + l + sovProfiles(uint64(l)) - return n -} - -func sovProfiles(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozProfiles(x uint64) (n int) { - return sovProfiles(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ProfilesData) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProfiles - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProfilesData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProfilesData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceProfiles", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProfiles - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProfiles - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProfiles - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResourceProfiles = append(m.ResourceProfiles, &ResourceProfiles{}) - if err := m.ResourceProfiles[len(m.ResourceProfiles)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProfiles(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProfiles - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ResourceProfiles) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProfiles - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ResourceProfiles: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResourceProfiles: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProfiles - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProfiles - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProfiles - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ScopeProfiles", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProfiles - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProfiles - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProfiles - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ScopeProfiles = append(m.ScopeProfiles, &ScopeProfiles{}) - if err := m.ScopeProfiles[len(m.ScopeProfiles)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SchemaUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProfiles - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProfiles - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProfiles - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SchemaUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProfiles(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProfiles - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ScopeProfiles) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProfiles - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ScopeProfiles: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ScopeProfiles: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Scope", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProfiles - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProfiles - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProfiles - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Scope.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Profiles", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProfiles - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProfiles - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProfiles - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Profiles = append(m.Profiles, &ProfileContainer{}) - if err := m.Profiles[len(m.Profiles)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SchemaUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProfiles - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProfiles - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProfiles - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SchemaUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProfiles(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProfiles - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProfileContainer) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProfiles - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProfileContainer: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProfileContainer: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProfileId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProfiles - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProfiles - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProfiles - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProfileId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTimeUnixNano", wireType) - } - m.StartTimeUnixNano = 0 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - m.StartTimeUnixNano = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - case 3: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTimeUnixNano", wireType) - } - m.EndTimeUnixNano = 0 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - m.EndTimeUnixNano = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProfiles - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProfiles - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProfiles - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Attributes = append(m.Attributes, v11.KeyValue{}) - if err := m.Attributes[len(m.Attributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DroppedAttributesCount", wireType) - } - m.DroppedAttributesCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProfiles - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DroppedAttributesCount |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OriginalPayloadFormat", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProfiles - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProfiles - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProfiles - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OriginalPayloadFormat = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OriginalPayload", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProfiles - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProfiles - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProfiles - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OriginalPayload = append(m.OriginalPayload[:0], dAtA[iNdEx:postIndex]...) - if m.OriginalPayload == nil { - m.OriginalPayload = []byte{} - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Profile", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProfiles - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProfiles - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProfiles - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Profile.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProfiles(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProfiles - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipProfiles(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProfiles - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProfiles - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProfiles - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthProfiles - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupProfiles - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthProfiles - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthProfiles = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProfiles = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupProfiles = fmt.Errorf("proto: unexpected end of group") -) diff --git a/pdata/internal/generated_wrapper_int32slice.go b/pdata/internal/generated_wrapper_int32slice.go new file mode 100644 index 00000000000..31f642d75bd --- /dev/null +++ b/pdata/internal/generated_wrapper_int32slice.go @@ -0,0 +1,34 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "make genpdata". + +package internal + +type Int32Slice struct { + orig *[]int32 + state *State +} + +func GetOrigInt32Slice(ms Int32Slice) *[]int32 { + return ms.orig +} + +func GetInt32SliceState(ms Int32Slice) *State { + return ms.state +} + +func NewInt32Slice(orig *[]int32, state *State) Int32Slice { + return Int32Slice{orig: orig, state: state} +} + +func FillTestInt32Slice(tv Int32Slice) { +} + +func GenerateTestInt32Slice() Int32Slice { + state := StateMutable + var orig []int32 = nil + + return Int32Slice{&orig, &state} +} diff --git a/pdata/internal/generated_wrapper_intslice.go b/pdata/internal/generated_wrapper_intslice.go new file mode 100644 index 00000000000..5f3fe569ba5 --- /dev/null +++ b/pdata/internal/generated_wrapper_intslice.go @@ -0,0 +1,34 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "make genpdata". + +package internal + +type IntSlice struct { + orig *[]int + state *State +} + +func GetOrigIntSlice(ms IntSlice) *[]int { + return ms.orig +} + +func GetIntSliceState(ms IntSlice) *State { + return ms.state +} + +func NewIntSlice(orig *[]int, state *State) IntSlice { + return IntSlice{orig: orig, state: state} +} + +func FillTestIntSlice(tv IntSlice) { +} + +func GenerateTestIntSlice() IntSlice { + state := StateMutable + var orig []int = nil + + return IntSlice{&orig, &state} +} diff --git a/pdata/internal/otlp/profiles.go b/pdata/internal/otlp/profiles.go index d134ccf9c06..59c23cc672b 100644 --- a/pdata/internal/otlp/profiles.go +++ b/pdata/internal/otlp/profiles.go @@ -4,7 +4,7 @@ package otlp // import "go.opentelemetry.io/collector/pdata/internal/otlp" import ( - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) // MigrateProfiles implements any translation needed due to deprecation in OTLP profiles protocol. diff --git a/pdata/internal/otlp/profiles_test.go b/pdata/internal/otlp/profiles_test.go index 91f9db32657..de1020bca35 100644 --- a/pdata/internal/otlp/profiles_test.go +++ b/pdata/internal/otlp/profiles_test.go @@ -6,7 +6,7 @@ package otlp import ( "testing" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) func TestMigrateProfiles(_ *testing.T) { diff --git a/pdata/internal/wrapper_profiles.go b/pdata/internal/wrapper_profiles.go index 564c8945862..2230b079c36 100644 --- a/pdata/internal/wrapper_profiles.go +++ b/pdata/internal/wrapper_profiles.go @@ -4,8 +4,8 @@ package internal // import "go.opentelemetry.io/collector/pdata/internal" import ( - otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1experimental" - otlpprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1development" + otlpprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) type Profiles struct { diff --git a/pdata/pcommon/generated_int32slice.go b/pdata/pcommon/generated_int32slice.go new file mode 100644 index 00000000000..35a40bd079c --- /dev/null +++ b/pdata/pcommon/generated_int32slice.go @@ -0,0 +1,108 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "make genpdata". + +package pcommon + +import ( + "go.opentelemetry.io/collector/pdata/internal" +) + +// Int32Slice represents a []int32 slice. +// The instance of Int32Slice can be assigned to multiple objects since it's immutable. +// +// Must use NewInt32Slice function to create new instances. +// Important: zero-initialized instance is not valid for use. +type Int32Slice internal.Int32Slice + +func (ms Int32Slice) getOrig() *[]int32 { + return internal.GetOrigInt32Slice(internal.Int32Slice(ms)) +} + +func (ms Int32Slice) getState() *internal.State { + return internal.GetInt32SliceState(internal.Int32Slice(ms)) +} + +// NewInt32Slice creates a new empty Int32Slice. +func NewInt32Slice() Int32Slice { + orig := []int32(nil) + state := internal.StateMutable + return Int32Slice(internal.NewInt32Slice(&orig, &state)) +} + +// AsRaw returns a copy of the []int32 slice. +func (ms Int32Slice) AsRaw() []int32 { + return copyInt32Slice(nil, *ms.getOrig()) +} + +// FromRaw copies raw []int32 into the slice Int32Slice. +func (ms Int32Slice) FromRaw(val []int32) { + ms.getState().AssertMutable() + *ms.getOrig() = copyInt32Slice(*ms.getOrig(), val) +} + +// Len returns length of the []int32 slice value. +// Equivalent of len(int32Slice). +func (ms Int32Slice) Len() int { + return len(*ms.getOrig()) +} + +// At returns an item from particular index. +// Equivalent of int32Slice[i]. +func (ms Int32Slice) At(i int) int32 { + return (*ms.getOrig())[i] +} + +// SetAt sets int32 item at particular index. +// Equivalent of int32Slice[i] = val +func (ms Int32Slice) SetAt(i int, val int32) { + ms.getState().AssertMutable() + (*ms.getOrig())[i] = val +} + +// EnsureCapacity ensures Int32Slice has at least the specified capacity. +// 1. If the newCap <= cap, then is no change in capacity. +// 2. If the newCap > cap, then the slice capacity will be expanded to the provided value which will be equivalent of: +// buf := make([]int32, len(int32Slice), newCap) +// copy(buf, int32Slice) +// int32Slice = buf +func (ms Int32Slice) EnsureCapacity(newCap int) { + ms.getState().AssertMutable() + oldCap := cap(*ms.getOrig()) + if newCap <= oldCap { + return + } + + newOrig := make([]int32, len(*ms.getOrig()), newCap) + copy(newOrig, *ms.getOrig()) + *ms.getOrig() = newOrig +} + +// Append appends extra elements to Int32Slice. +// Equivalent of int32Slice = append(int32Slice, elms...) +func (ms Int32Slice) Append(elms ...int32) { + ms.getState().AssertMutable() + *ms.getOrig() = append(*ms.getOrig(), elms...) +} + +// MoveTo moves all elements from the current slice overriding the destination and +// resetting the current instance to its zero value. +func (ms Int32Slice) MoveTo(dest Int32Slice) { + ms.getState().AssertMutable() + dest.getState().AssertMutable() + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = nil +} + +// CopyTo copies all elements from the current slice overriding the destination. +func (ms Int32Slice) CopyTo(dest Int32Slice) { + dest.getState().AssertMutable() + *dest.getOrig() = copyInt32Slice(*dest.getOrig(), *ms.getOrig()) +} + +func copyInt32Slice(dst, src []int32) []int32 { + dst = dst[:0] + return append(dst, src...) +} diff --git a/pdata/pcommon/generated_int32slice_test.go b/pdata/pcommon/generated_int32slice_test.go new file mode 100644 index 00000000000..b6308fb91fd --- /dev/null +++ b/pdata/pcommon/generated_int32slice_test.go @@ -0,0 +1,83 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "make genpdata". + +package pcommon + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "go.opentelemetry.io/collector/pdata/internal" +) + +func TestNewInt32Slice(t *testing.T) { + ms := NewInt32Slice() + assert.Equal(t, 0, ms.Len()) + ms.FromRaw([]int32{1, 2, 3}) + assert.Equal(t, 3, ms.Len()) + assert.Equal(t, []int32{1, 2, 3}, ms.AsRaw()) + ms.SetAt(1, int32(5)) + assert.Equal(t, []int32{1, 5, 3}, ms.AsRaw()) + ms.FromRaw([]int32{3}) + assert.Equal(t, 1, ms.Len()) + assert.Equal(t, int32(3), ms.At(0)) + + cp := NewInt32Slice() + ms.CopyTo(cp) + ms.SetAt(0, int32(2)) + assert.Equal(t, int32(2), ms.At(0)) + assert.Equal(t, int32(3), cp.At(0)) + ms.CopyTo(cp) + assert.Equal(t, int32(2), cp.At(0)) + + mv := NewInt32Slice() + ms.MoveTo(mv) + assert.Equal(t, 0, ms.Len()) + assert.Equal(t, 1, mv.Len()) + assert.Equal(t, int32(2), mv.At(0)) + ms.FromRaw([]int32{1, 2, 3}) + ms.MoveTo(mv) + assert.Equal(t, 3, mv.Len()) + assert.Equal(t, int32(1), mv.At(0)) +} + +func TestInt32SliceReadOnly(t *testing.T) { + raw := []int32{1, 2, 3} + state := internal.StateReadOnly + ms := Int32Slice(internal.NewInt32Slice(&raw, &state)) + + assert.Equal(t, 3, ms.Len()) + assert.Equal(t, int32(1), ms.At(0)) + assert.Panics(t, func() { ms.Append(1) }) + assert.Panics(t, func() { ms.EnsureCapacity(2) }) + assert.Equal(t, raw, ms.AsRaw()) + assert.Panics(t, func() { ms.FromRaw(raw) }) + + ms2 := NewInt32Slice() + ms.CopyTo(ms2) + assert.Equal(t, ms.AsRaw(), ms2.AsRaw()) + assert.Panics(t, func() { ms2.CopyTo(ms) }) + + assert.Panics(t, func() { ms.MoveTo(ms2) }) + assert.Panics(t, func() { ms2.MoveTo(ms) }) +} + +func TestInt32SliceAppend(t *testing.T) { + ms := NewInt32Slice() + ms.FromRaw([]int32{1, 2, 3}) + ms.Append(5, 5) + assert.Equal(t, 5, ms.Len()) + assert.Equal(t, int32(5), ms.At(4)) +} + +func TestInt32SliceEnsureCapacity(t *testing.T) { + ms := NewInt32Slice() + ms.EnsureCapacity(4) + assert.Equal(t, 4, cap(*ms.getOrig())) + ms.EnsureCapacity(2) + assert.Equal(t, 4, cap(*ms.getOrig())) +} diff --git a/pdata/pcommon/generated_intslice.go b/pdata/pcommon/generated_intslice.go new file mode 100644 index 00000000000..1a72889d554 --- /dev/null +++ b/pdata/pcommon/generated_intslice.go @@ -0,0 +1,108 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "make genpdata". + +package pcommon + +import ( + "go.opentelemetry.io/collector/pdata/internal" +) + +// IntSlice represents a []int slice. +// The instance of IntSlice can be assigned to multiple objects since it's immutable. +// +// Must use NewIntSlice function to create new instances. +// Important: zero-initialized instance is not valid for use. +type IntSlice internal.IntSlice + +func (ms IntSlice) getOrig() *[]int { + return internal.GetOrigIntSlice(internal.IntSlice(ms)) +} + +func (ms IntSlice) getState() *internal.State { + return internal.GetIntSliceState(internal.IntSlice(ms)) +} + +// NewIntSlice creates a new empty IntSlice. +func NewIntSlice() IntSlice { + orig := []int(nil) + state := internal.StateMutable + return IntSlice(internal.NewIntSlice(&orig, &state)) +} + +// AsRaw returns a copy of the []int slice. +func (ms IntSlice) AsRaw() []int { + return copyIntSlice(nil, *ms.getOrig()) +} + +// FromRaw copies raw []int into the slice IntSlice. +func (ms IntSlice) FromRaw(val []int) { + ms.getState().AssertMutable() + *ms.getOrig() = copyIntSlice(*ms.getOrig(), val) +} + +// Len returns length of the []int slice value. +// Equivalent of len(intSlice). +func (ms IntSlice) Len() int { + return len(*ms.getOrig()) +} + +// At returns an item from particular index. +// Equivalent of intSlice[i]. +func (ms IntSlice) At(i int) int { + return (*ms.getOrig())[i] +} + +// SetAt sets int item at particular index. +// Equivalent of intSlice[i] = val +func (ms IntSlice) SetAt(i int, val int) { + ms.getState().AssertMutable() + (*ms.getOrig())[i] = val +} + +// EnsureCapacity ensures IntSlice has at least the specified capacity. +// 1. If the newCap <= cap, then is no change in capacity. +// 2. If the newCap > cap, then the slice capacity will be expanded to the provided value which will be equivalent of: +// buf := make([]int, len(intSlice), newCap) +// copy(buf, intSlice) +// intSlice = buf +func (ms IntSlice) EnsureCapacity(newCap int) { + ms.getState().AssertMutable() + oldCap := cap(*ms.getOrig()) + if newCap <= oldCap { + return + } + + newOrig := make([]int, len(*ms.getOrig()), newCap) + copy(newOrig, *ms.getOrig()) + *ms.getOrig() = newOrig +} + +// Append appends extra elements to IntSlice. +// Equivalent of intSlice = append(intSlice, elms...) +func (ms IntSlice) Append(elms ...int) { + ms.getState().AssertMutable() + *ms.getOrig() = append(*ms.getOrig(), elms...) +} + +// MoveTo moves all elements from the current slice overriding the destination and +// resetting the current instance to its zero value. +func (ms IntSlice) MoveTo(dest IntSlice) { + ms.getState().AssertMutable() + dest.getState().AssertMutable() + *dest.getOrig() = *ms.getOrig() + *ms.getOrig() = nil +} + +// CopyTo copies all elements from the current slice overriding the destination. +func (ms IntSlice) CopyTo(dest IntSlice) { + dest.getState().AssertMutable() + *dest.getOrig() = copyIntSlice(*dest.getOrig(), *ms.getOrig()) +} + +func copyIntSlice(dst, src []int) []int { + dst = dst[:0] + return append(dst, src...) +} diff --git a/pdata/pcommon/generated_intslice_test.go b/pdata/pcommon/generated_intslice_test.go new file mode 100644 index 00000000000..ab5051dfcb8 --- /dev/null +++ b/pdata/pcommon/generated_intslice_test.go @@ -0,0 +1,83 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "make genpdata". + +package pcommon + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "go.opentelemetry.io/collector/pdata/internal" +) + +func TestNewIntSlice(t *testing.T) { + ms := NewIntSlice() + assert.Equal(t, 0, ms.Len()) + ms.FromRaw([]int{1, 2, 3}) + assert.Equal(t, 3, ms.Len()) + assert.Equal(t, []int{1, 2, 3}, ms.AsRaw()) + ms.SetAt(1, int(5)) + assert.Equal(t, []int{1, 5, 3}, ms.AsRaw()) + ms.FromRaw([]int{3}) + assert.Equal(t, 1, ms.Len()) + assert.Equal(t, int(3), ms.At(0)) + + cp := NewIntSlice() + ms.CopyTo(cp) + ms.SetAt(0, int(2)) + assert.Equal(t, int(2), ms.At(0)) + assert.Equal(t, int(3), cp.At(0)) + ms.CopyTo(cp) + assert.Equal(t, int(2), cp.At(0)) + + mv := NewIntSlice() + ms.MoveTo(mv) + assert.Equal(t, 0, ms.Len()) + assert.Equal(t, 1, mv.Len()) + assert.Equal(t, int(2), mv.At(0)) + ms.FromRaw([]int{1, 2, 3}) + ms.MoveTo(mv) + assert.Equal(t, 3, mv.Len()) + assert.Equal(t, int(1), mv.At(0)) +} + +func TestIntSliceReadOnly(t *testing.T) { + raw := []int{1, 2, 3} + state := internal.StateReadOnly + ms := IntSlice(internal.NewIntSlice(&raw, &state)) + + assert.Equal(t, 3, ms.Len()) + assert.Equal(t, int(1), ms.At(0)) + assert.Panics(t, func() { ms.Append(1) }) + assert.Panics(t, func() { ms.EnsureCapacity(2) }) + assert.Equal(t, raw, ms.AsRaw()) + assert.Panics(t, func() { ms.FromRaw(raw) }) + + ms2 := NewIntSlice() + ms.CopyTo(ms2) + assert.Equal(t, ms.AsRaw(), ms2.AsRaw()) + assert.Panics(t, func() { ms2.CopyTo(ms) }) + + assert.Panics(t, func() { ms.MoveTo(ms2) }) + assert.Panics(t, func() { ms2.MoveTo(ms) }) +} + +func TestIntSliceAppend(t *testing.T) { + ms := NewIntSlice() + ms.FromRaw([]int{1, 2, 3}) + ms.Append(5, 5) + assert.Equal(t, 5, ms.Len()) + assert.Equal(t, int(5), ms.At(4)) +} + +func TestIntSliceEnsureCapacity(t *testing.T) { + ms := NewIntSlice() + ms.EnsureCapacity(4) + assert.Equal(t, 4, cap(*ms.getOrig())) + ms.EnsureCapacity(2) + assert.Equal(t, 4, cap(*ms.getOrig())) +} diff --git a/pdata/pprofile/generated_attribute.go b/pdata/pprofile/generated_attribute.go new file mode 100644 index 00000000000..059b89be727 --- /dev/null +++ b/pdata/pprofile/generated_attribute.go @@ -0,0 +1,70 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "make genpdata". + +package pprofile + +import ( + "go.opentelemetry.io/collector/pdata/internal" + v1 "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" + "go.opentelemetry.io/collector/pdata/pcommon" +) + +// Attribute describes an attribute stored in a profile's attribute table. +// +// This is a reference type, if passed by value and callee modifies it the +// caller will see the modification. +// +// Must use NewAttribute function to create new instances. +// Important: zero-initialized instance is not valid for use. +type Attribute struct { + orig *v1.KeyValue + state *internal.State +} + +func newAttribute(orig *v1.KeyValue, state *internal.State) Attribute { + return Attribute{orig: orig, state: state} +} + +// NewAttribute creates a new empty Attribute. +// +// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, +// OR directly access the member if this is embedded in another struct. +func NewAttribute() Attribute { + state := internal.StateMutable + return newAttribute(&v1.KeyValue{}, &state) +} + +// MoveTo moves all properties from the current struct overriding the destination and +// resetting the current instance to its zero value +func (ms Attribute) MoveTo(dest Attribute) { + ms.state.AssertMutable() + dest.state.AssertMutable() + *dest.orig = *ms.orig + *ms.orig = v1.KeyValue{} +} + +// Key returns the key associated with this Attribute. +func (ms Attribute) Key() string { + return ms.orig.Key +} + +// SetKey replaces the key associated with this Attribute. +func (ms Attribute) SetKey(v string) { + ms.state.AssertMutable() + ms.orig.Key = v +} + +// Value returns the value associated with this Attribute. +func (ms Attribute) Value() pcommon.Value { + return pcommon.Value(internal.NewValue(&ms.orig.Value, ms.state)) +} + +// CopyTo copies all properties from the current struct overriding the destination. +func (ms Attribute) CopyTo(dest Attribute) { + dest.state.AssertMutable() + dest.SetKey(ms.Key()) + ms.Value().CopyTo(dest.Value()) +} diff --git a/pdata/pprofile/generated_attribute_test.go b/pdata/pprofile/generated_attribute_test.go new file mode 100644 index 00000000000..cf866daed82 --- /dev/null +++ b/pdata/pprofile/generated_attribute_test.go @@ -0,0 +1,66 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "make genpdata". + +package pprofile + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "go.opentelemetry.io/collector/pdata/internal" + v1 "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" + "go.opentelemetry.io/collector/pdata/pcommon" +) + +func TestAttribute_MoveTo(t *testing.T) { + ms := generateTestAttribute() + dest := NewAttribute() + ms.MoveTo(dest) + assert.Equal(t, NewAttribute(), ms) + assert.Equal(t, generateTestAttribute(), dest) + sharedState := internal.StateReadOnly + assert.Panics(t, func() { ms.MoveTo(newAttribute(&v1.KeyValue{}, &sharedState)) }) + assert.Panics(t, func() { newAttribute(&v1.KeyValue{}, &sharedState).MoveTo(dest) }) +} + +func TestAttribute_CopyTo(t *testing.T) { + ms := NewAttribute() + orig := NewAttribute() + orig.CopyTo(ms) + assert.Equal(t, orig, ms) + orig = generateTestAttribute() + orig.CopyTo(ms) + assert.Equal(t, orig, ms) + sharedState := internal.StateReadOnly + assert.Panics(t, func() { ms.CopyTo(newAttribute(&v1.KeyValue{}, &sharedState)) }) +} + +func TestAttribute_Key(t *testing.T) { + ms := NewAttribute() + assert.Equal(t, "", ms.Key()) + ms.SetKey("key") + assert.Equal(t, "key", ms.Key()) + sharedState := internal.StateReadOnly + assert.Panics(t, func() { newAttribute(&v1.KeyValue{}, &sharedState).SetKey("key") }) +} + +func TestAttribute_Value(t *testing.T) { + ms := NewAttribute() + internal.FillTestValue(internal.Value(ms.Value())) + assert.Equal(t, pcommon.Value(internal.GenerateTestValue()), ms.Value()) +} + +func generateTestAttribute() Attribute { + tv := NewAttribute() + fillTestAttribute(tv) + return tv +} + +func fillTestAttribute(tv Attribute) { + tv.orig.Key = "key" + internal.FillTestValue(internal.NewValue(&tv.orig.Value, tv.state)) +} diff --git a/pdata/pprofile/generated_profilescontainersslice.go b/pdata/pprofile/generated_attributetableslice.go similarity index 50% rename from pdata/pprofile/generated_profilescontainersslice.go rename to pdata/pprofile/generated_attributetableslice.go index 74ac2cc4578..731847d000b 100644 --- a/pdata/pprofile/generated_profilescontainersslice.go +++ b/pdata/pprofile/generated_attributetableslice.go @@ -7,40 +7,38 @@ package pprofile import ( - "sort" - "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + v1 "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" ) -// ProfilesContainersSlice logically represents a slice of ProfileContainer. +// AttributeTableSlice logically represents a slice of Attribute. // // This is a reference type. If passed by value and callee modifies it, the // caller will see the modification. // -// Must use NewProfilesContainersSlice function to create new instances. +// Must use NewAttributeTableSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type ProfilesContainersSlice struct { - orig *[]*otlpprofiles.ProfileContainer +type AttributeTableSlice struct { + orig *[]v1.KeyValue state *internal.State } -func newProfilesContainersSlice(orig *[]*otlpprofiles.ProfileContainer, state *internal.State) ProfilesContainersSlice { - return ProfilesContainersSlice{orig: orig, state: state} +func newAttributeTableSlice(orig *[]v1.KeyValue, state *internal.State) AttributeTableSlice { + return AttributeTableSlice{orig: orig, state: state} } -// NewProfilesContainersSlice creates a ProfilesContainersSlice with 0 elements. +// NewAttributeTableSlice creates a AttributeTableSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. -func NewProfilesContainersSlice() ProfilesContainersSlice { - orig := []*otlpprofiles.ProfileContainer(nil) +func NewAttributeTableSlice() AttributeTableSlice { + orig := []v1.KeyValue(nil) state := internal.StateMutable - return newProfilesContainersSlice(&orig, &state) + return newAttributeTableSlice(&orig, &state) } // Len returns the number of elements in the slice. // -// Returns "0" for a newly instance created with "NewProfilesContainersSlice()". -func (es ProfilesContainersSlice) Len() int { +// Returns "0" for a newly instance created with "NewAttributeTableSlice()". +func (es AttributeTableSlice) Len() int { return len(*es.orig) } @@ -52,45 +50,45 @@ func (es ProfilesContainersSlice) Len() int { // e := es.At(i) // ... // Do something with the element // } -func (es ProfilesContainersSlice) At(i int) ProfileContainer { - return newProfileContainer((*es.orig)[i], es.state) +func (es AttributeTableSlice) At(i int) Attribute { + return newAttribute(&(*es.orig)[i], es.state) } // EnsureCapacity is an operation that ensures the slice has at least the specified capacity. // 1. If the newCap <= cap then no change in capacity. // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // -// Here is how a new ProfilesContainersSlice can be initialized: +// Here is how a new AttributeTableSlice can be initialized: // -// es := NewProfilesContainersSlice() +// es := NewAttributeTableSlice() // es.EnsureCapacity(4) // for i := 0; i < 4; i++ { // e := es.AppendEmpty() // // Here should set all the values for e. // } -func (es ProfilesContainersSlice) EnsureCapacity(newCap int) { +func (es AttributeTableSlice) EnsureCapacity(newCap int) { es.state.AssertMutable() oldCap := cap(*es.orig) if newCap <= oldCap { return } - newOrig := make([]*otlpprofiles.ProfileContainer, len(*es.orig), newCap) + newOrig := make([]v1.KeyValue, len(*es.orig), newCap) copy(newOrig, *es.orig) *es.orig = newOrig } -// AppendEmpty will append to the end of the slice an empty ProfileContainer. -// It returns the newly added ProfileContainer. -func (es ProfilesContainersSlice) AppendEmpty() ProfileContainer { +// AppendEmpty will append to the end of the slice an empty Attribute. +// It returns the newly added Attribute. +func (es AttributeTableSlice) AppendEmpty() Attribute { es.state.AssertMutable() - *es.orig = append(*es.orig, &otlpprofiles.ProfileContainer{}) + *es.orig = append(*es.orig, v1.KeyValue{}) return es.At(es.Len() - 1) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. -func (es ProfilesContainersSlice) MoveAndAppendTo(dest ProfilesContainersSlice) { +func (es AttributeTableSlice) MoveAndAppendTo(dest AttributeTableSlice) { es.state.AssertMutable() dest.state.AssertMutable() if *dest.orig == nil { @@ -104,7 +102,7 @@ func (es ProfilesContainersSlice) MoveAndAppendTo(dest ProfilesContainersSlice) // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. -func (es ProfilesContainersSlice) RemoveIf(f func(ProfileContainer) bool) { +func (es AttributeTableSlice) RemoveIf(f func(Attribute) bool) { es.state.AssertMutable() newLen := 0 for i := 0; i < len(*es.orig); i++ { @@ -123,30 +121,16 @@ func (es ProfilesContainersSlice) RemoveIf(f func(ProfileContainer) bool) { } // CopyTo copies all elements from the current slice overriding the destination. -func (es ProfilesContainersSlice) CopyTo(dest ProfilesContainersSlice) { +func (es AttributeTableSlice) CopyTo(dest AttributeTableSlice) { dest.state.AssertMutable() srcLen := es.Len() destCap := cap(*dest.orig) if srcLen <= destCap { (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newProfileContainer((*es.orig)[i], es.state).CopyTo(newProfileContainer((*dest.orig)[i], dest.state)) - } - return + } else { + (*dest.orig) = make([]v1.KeyValue, srcLen) } - origs := make([]otlpprofiles.ProfileContainer, srcLen) - wrappers := make([]*otlpprofiles.ProfileContainer, srcLen) for i := range *es.orig { - wrappers[i] = &origs[i] - newProfileContainer((*es.orig)[i], es.state).CopyTo(newProfileContainer(wrappers[i], dest.state)) + newAttribute(&(*es.orig)[i], es.state).CopyTo(newAttribute(&(*dest.orig)[i], dest.state)) } - *dest.orig = wrappers -} - -// Sort sorts the ProfileContainer elements within ProfilesContainersSlice given the -// provided less function so that two instances of ProfilesContainersSlice -// can be compared. -func (es ProfilesContainersSlice) Sort(less func(a, b ProfileContainer) bool) { - es.state.AssertMutable() - sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } diff --git a/pdata/pprofile/generated_attributetableslice_test.go b/pdata/pprofile/generated_attributetableslice_test.go new file mode 100644 index 00000000000..3dc38179da7 --- /dev/null +++ b/pdata/pprofile/generated_attributetableslice_test.go @@ -0,0 +1,137 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. +// To regenerate this file run "make genpdata". + +package pprofile + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "go.opentelemetry.io/collector/pdata/internal" + v1 "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" +) + +func TestAttributeTableSlice(t *testing.T) { + es := NewAttributeTableSlice() + assert.Equal(t, 0, es.Len()) + state := internal.StateMutable + es = newAttributeTableSlice(&[]v1.KeyValue{}, &state) + assert.Equal(t, 0, es.Len()) + + emptyVal := NewAttribute() + testVal := generateTestAttribute() + for i := 0; i < 7; i++ { + el := es.AppendEmpty() + assert.Equal(t, emptyVal, es.At(i)) + fillTestAttribute(el) + assert.Equal(t, testVal, es.At(i)) + } + assert.Equal(t, 7, es.Len()) +} + +func TestAttributeTableSliceReadOnly(t *testing.T) { + sharedState := internal.StateReadOnly + es := newAttributeTableSlice(&[]v1.KeyValue{}, &sharedState) + assert.Equal(t, 0, es.Len()) + assert.Panics(t, func() { es.AppendEmpty() }) + assert.Panics(t, func() { es.EnsureCapacity(2) }) + es2 := NewAttributeTableSlice() + es.CopyTo(es2) + assert.Panics(t, func() { es2.CopyTo(es) }) + assert.Panics(t, func() { es.MoveAndAppendTo(es2) }) + assert.Panics(t, func() { es2.MoveAndAppendTo(es) }) +} + +func TestAttributeTableSlice_CopyTo(t *testing.T) { + dest := NewAttributeTableSlice() + // Test CopyTo to empty + NewAttributeTableSlice().CopyTo(dest) + assert.Equal(t, NewAttributeTableSlice(), dest) + + // Test CopyTo larger slice + generateTestAttributeTableSlice().CopyTo(dest) + assert.Equal(t, generateTestAttributeTableSlice(), dest) + + // Test CopyTo same size slice + generateTestAttributeTableSlice().CopyTo(dest) + assert.Equal(t, generateTestAttributeTableSlice(), dest) +} + +func TestAttributeTableSlice_EnsureCapacity(t *testing.T) { + es := generateTestAttributeTableSlice() + + // Test ensure smaller capacity. + const ensureSmallLen = 4 + es.EnsureCapacity(ensureSmallLen) + assert.Less(t, ensureSmallLen, es.Len()) + assert.Equal(t, es.Len(), cap(*es.orig)) + assert.Equal(t, generateTestAttributeTableSlice(), es) + + // Test ensure larger capacity + const ensureLargeLen = 9 + es.EnsureCapacity(ensureLargeLen) + assert.Less(t, generateTestAttributeTableSlice().Len(), ensureLargeLen) + assert.Equal(t, ensureLargeLen, cap(*es.orig)) + assert.Equal(t, generateTestAttributeTableSlice(), es) +} + +func TestAttributeTableSlice_MoveAndAppendTo(t *testing.T) { + // Test MoveAndAppendTo to empty + expectedSlice := generateTestAttributeTableSlice() + dest := NewAttributeTableSlice() + src := generateTestAttributeTableSlice() + src.MoveAndAppendTo(dest) + assert.Equal(t, generateTestAttributeTableSlice(), dest) + assert.Equal(t, 0, src.Len()) + assert.Equal(t, expectedSlice.Len(), dest.Len()) + + // Test MoveAndAppendTo empty slice + src.MoveAndAppendTo(dest) + assert.Equal(t, generateTestAttributeTableSlice(), dest) + assert.Equal(t, 0, src.Len()) + assert.Equal(t, expectedSlice.Len(), dest.Len()) + + // Test MoveAndAppendTo not empty slice + generateTestAttributeTableSlice().MoveAndAppendTo(dest) + assert.Equal(t, 2*expectedSlice.Len(), dest.Len()) + for i := 0; i < expectedSlice.Len(); i++ { + assert.Equal(t, expectedSlice.At(i), dest.At(i)) + assert.Equal(t, expectedSlice.At(i), dest.At(i+expectedSlice.Len())) + } +} + +func TestAttributeTableSlice_RemoveIf(t *testing.T) { + // Test RemoveIf on empty slice + emptySlice := NewAttributeTableSlice() + emptySlice.RemoveIf(func(el Attribute) bool { + t.Fail() + return false + }) + + // Test RemoveIf + filtered := generateTestAttributeTableSlice() + pos := 0 + filtered.RemoveIf(func(el Attribute) bool { + pos++ + return pos%3 == 0 + }) + assert.Equal(t, 5, filtered.Len()) +} + +func generateTestAttributeTableSlice() AttributeTableSlice { + es := NewAttributeTableSlice() + fillTestAttributeTableSlice(es) + return es +} + +func fillTestAttributeTableSlice(es AttributeTableSlice) { + *es.orig = make([]v1.KeyValue, 7) + for i := 0; i < 7; i++ { + (*es.orig)[i] = v1.KeyValue{} + fillTestAttribute(newAttribute(&(*es.orig)[i], es.state)) + } +} diff --git a/pdata/pprofile/generated_attributeunit.go b/pdata/pprofile/generated_attributeunit.go index bb6f5e4d0dd..a7d98f425d4 100644 --- a/pdata/pprofile/generated_attributeunit.go +++ b/pdata/pprofile/generated_attributeunit.go @@ -8,7 +8,7 @@ package pprofile import ( "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) // AttributeUnit Represents a mapping between Attribute Keys and Units. @@ -45,31 +45,31 @@ func (ms AttributeUnit) MoveTo(dest AttributeUnit) { *ms.orig = otlpprofiles.AttributeUnit{} } -// AttributeKey returns the attributekey associated with this AttributeUnit. -func (ms AttributeUnit) AttributeKey() int64 { - return ms.orig.AttributeKey +// AttributeKeyStrindex returns the attributekeystrindex associated with this AttributeUnit. +func (ms AttributeUnit) AttributeKeyStrindex() int32 { + return ms.orig.AttributeKeyStrindex } -// SetAttributeKey replaces the attributekey associated with this AttributeUnit. -func (ms AttributeUnit) SetAttributeKey(v int64) { +// SetAttributeKeyStrindex replaces the attributekeystrindex associated with this AttributeUnit. +func (ms AttributeUnit) SetAttributeKeyStrindex(v int32) { ms.state.AssertMutable() - ms.orig.AttributeKey = v + ms.orig.AttributeKeyStrindex = v } -// Unit returns the unit associated with this AttributeUnit. -func (ms AttributeUnit) Unit() int64 { - return ms.orig.Unit +// UnitStrindex returns the unitstrindex associated with this AttributeUnit. +func (ms AttributeUnit) UnitStrindex() int32 { + return ms.orig.UnitStrindex } -// SetUnit replaces the unit associated with this AttributeUnit. -func (ms AttributeUnit) SetUnit(v int64) { +// SetUnitStrindex replaces the unitstrindex associated with this AttributeUnit. +func (ms AttributeUnit) SetUnitStrindex(v int32) { ms.state.AssertMutable() - ms.orig.Unit = v + ms.orig.UnitStrindex = v } // CopyTo copies all properties from the current struct overriding the destination. func (ms AttributeUnit) CopyTo(dest AttributeUnit) { dest.state.AssertMutable() - dest.SetAttributeKey(ms.AttributeKey()) - dest.SetUnit(ms.Unit()) + dest.SetAttributeKeyStrindex(ms.AttributeKeyStrindex()) + dest.SetUnitStrindex(ms.UnitStrindex()) } diff --git a/pdata/pprofile/generated_attributeunit_test.go b/pdata/pprofile/generated_attributeunit_test.go index e4a54c99b12..b0ff456af76 100644 --- a/pdata/pprofile/generated_attributeunit_test.go +++ b/pdata/pprofile/generated_attributeunit_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) func TestAttributeUnit_MoveTo(t *testing.T) { @@ -38,22 +38,24 @@ func TestAttributeUnit_CopyTo(t *testing.T) { assert.Panics(t, func() { ms.CopyTo(newAttributeUnit(&otlpprofiles.AttributeUnit{}, &sharedState)) }) } -func TestAttributeUnit_AttributeKey(t *testing.T) { +func TestAttributeUnit_AttributeKeyStrindex(t *testing.T) { ms := NewAttributeUnit() - assert.Equal(t, int64(0), ms.AttributeKey()) - ms.SetAttributeKey(int64(1)) - assert.Equal(t, int64(1), ms.AttributeKey()) + assert.Equal(t, int32(0), ms.AttributeKeyStrindex()) + ms.SetAttributeKeyStrindex(int32(1)) + assert.Equal(t, int32(1), ms.AttributeKeyStrindex()) sharedState := internal.StateReadOnly - assert.Panics(t, func() { newAttributeUnit(&otlpprofiles.AttributeUnit{}, &sharedState).SetAttributeKey(int64(1)) }) + assert.Panics(t, func() { + newAttributeUnit(&otlpprofiles.AttributeUnit{}, &sharedState).SetAttributeKeyStrindex(int32(1)) + }) } -func TestAttributeUnit_Unit(t *testing.T) { +func TestAttributeUnit_UnitStrindex(t *testing.T) { ms := NewAttributeUnit() - assert.Equal(t, int64(0), ms.Unit()) - ms.SetUnit(int64(1)) - assert.Equal(t, int64(1), ms.Unit()) + assert.Equal(t, int32(0), ms.UnitStrindex()) + ms.SetUnitStrindex(int32(1)) + assert.Equal(t, int32(1), ms.UnitStrindex()) sharedState := internal.StateReadOnly - assert.Panics(t, func() { newAttributeUnit(&otlpprofiles.AttributeUnit{}, &sharedState).SetUnit(int64(1)) }) + assert.Panics(t, func() { newAttributeUnit(&otlpprofiles.AttributeUnit{}, &sharedState).SetUnitStrindex(int32(1)) }) } func generateTestAttributeUnit() AttributeUnit { @@ -63,6 +65,6 @@ func generateTestAttributeUnit() AttributeUnit { } func fillTestAttributeUnit(tv AttributeUnit) { - tv.orig.AttributeKey = int64(1) - tv.orig.Unit = int64(1) + tv.orig.AttributeKeyStrindex = int32(1) + tv.orig.UnitStrindex = int32(1) } diff --git a/pdata/pprofile/generated_attributeunitslice.go b/pdata/pprofile/generated_attributeunitslice.go index eaf8baf57ed..f7d1c41a1e1 100644 --- a/pdata/pprofile/generated_attributeunitslice.go +++ b/pdata/pprofile/generated_attributeunitslice.go @@ -10,7 +10,7 @@ import ( "sort" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) // AttributeUnitSlice logically represents a slice of AttributeUnit. diff --git a/pdata/pprofile/generated_attributeunitslice_test.go b/pdata/pprofile/generated_attributeunitslice_test.go index 6fa007bca75..a6195a87b76 100644 --- a/pdata/pprofile/generated_attributeunitslice_test.go +++ b/pdata/pprofile/generated_attributeunitslice_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) func TestAttributeUnitSlice(t *testing.T) { diff --git a/pdata/pprofile/generated_function.go b/pdata/pprofile/generated_function.go index 324b8c7b109..21fe358de8f 100644 --- a/pdata/pprofile/generated_function.go +++ b/pdata/pprofile/generated_function.go @@ -8,7 +8,7 @@ package pprofile import ( "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) // Function describes a function, including its human-readable name, system name, source file, and starting line number in the source. @@ -45,48 +45,37 @@ func (ms Function) MoveTo(dest Function) { *ms.orig = otlpprofiles.Function{} } -// ID returns the id associated with this Function. -func (ms Function) ID() uint64 { - return ms.orig.Id +// NameStrindex returns the namestrindex associated with this Function. +func (ms Function) NameStrindex() int32 { + return ms.orig.NameStrindex } -// SetID replaces the id associated with this Function. -func (ms Function) SetID(v uint64) { +// SetNameStrindex replaces the namestrindex associated with this Function. +func (ms Function) SetNameStrindex(v int32) { ms.state.AssertMutable() - ms.orig.Id = v + ms.orig.NameStrindex = v } -// Name returns the name associated with this Function. -func (ms Function) Name() int64 { - return ms.orig.Name +// SystemNameStrindex returns the systemnamestrindex associated with this Function. +func (ms Function) SystemNameStrindex() int32 { + return ms.orig.SystemNameStrindex } -// SetName replaces the name associated with this Function. -func (ms Function) SetName(v int64) { +// SetSystemNameStrindex replaces the systemnamestrindex associated with this Function. +func (ms Function) SetSystemNameStrindex(v int32) { ms.state.AssertMutable() - ms.orig.Name = v + ms.orig.SystemNameStrindex = v } -// SystemName returns the systemname associated with this Function. -func (ms Function) SystemName() int64 { - return ms.orig.SystemName +// FilenameStrindex returns the filenamestrindex associated with this Function. +func (ms Function) FilenameStrindex() int32 { + return ms.orig.FilenameStrindex } -// SetSystemName replaces the systemname associated with this Function. -func (ms Function) SetSystemName(v int64) { +// SetFilenameStrindex replaces the filenamestrindex associated with this Function. +func (ms Function) SetFilenameStrindex(v int32) { ms.state.AssertMutable() - ms.orig.SystemName = v -} - -// Filename returns the filename associated with this Function. -func (ms Function) Filename() int64 { - return ms.orig.Filename -} - -// SetFilename replaces the filename associated with this Function. -func (ms Function) SetFilename(v int64) { - ms.state.AssertMutable() - ms.orig.Filename = v + ms.orig.FilenameStrindex = v } // StartLine returns the startline associated with this Function. @@ -103,9 +92,8 @@ func (ms Function) SetStartLine(v int64) { // CopyTo copies all properties from the current struct overriding the destination. func (ms Function) CopyTo(dest Function) { dest.state.AssertMutable() - dest.SetID(ms.ID()) - dest.SetName(ms.Name()) - dest.SetSystemName(ms.SystemName()) - dest.SetFilename(ms.Filename()) + dest.SetNameStrindex(ms.NameStrindex()) + dest.SetSystemNameStrindex(ms.SystemNameStrindex()) + dest.SetFilenameStrindex(ms.FilenameStrindex()) dest.SetStartLine(ms.StartLine()) } diff --git a/pdata/pprofile/generated_function_test.go b/pdata/pprofile/generated_function_test.go index 83f0ace5d10..813047bd8ef 100644 --- a/pdata/pprofile/generated_function_test.go +++ b/pdata/pprofile/generated_function_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) func TestFunction_MoveTo(t *testing.T) { @@ -38,40 +38,31 @@ func TestFunction_CopyTo(t *testing.T) { assert.Panics(t, func() { ms.CopyTo(newFunction(&otlpprofiles.Function{}, &sharedState)) }) } -func TestFunction_ID(t *testing.T) { +func TestFunction_NameStrindex(t *testing.T) { ms := NewFunction() - assert.Equal(t, uint64(0), ms.ID()) - ms.SetID(uint64(1)) - assert.Equal(t, uint64(1), ms.ID()) + assert.Equal(t, int32(0), ms.NameStrindex()) + ms.SetNameStrindex(int32(1)) + assert.Equal(t, int32(1), ms.NameStrindex()) sharedState := internal.StateReadOnly - assert.Panics(t, func() { newFunction(&otlpprofiles.Function{}, &sharedState).SetID(uint64(1)) }) + assert.Panics(t, func() { newFunction(&otlpprofiles.Function{}, &sharedState).SetNameStrindex(int32(1)) }) } -func TestFunction_Name(t *testing.T) { +func TestFunction_SystemNameStrindex(t *testing.T) { ms := NewFunction() - assert.Equal(t, int64(0), ms.Name()) - ms.SetName(int64(1)) - assert.Equal(t, int64(1), ms.Name()) + assert.Equal(t, int32(0), ms.SystemNameStrindex()) + ms.SetSystemNameStrindex(int32(1)) + assert.Equal(t, int32(1), ms.SystemNameStrindex()) sharedState := internal.StateReadOnly - assert.Panics(t, func() { newFunction(&otlpprofiles.Function{}, &sharedState).SetName(int64(1)) }) + assert.Panics(t, func() { newFunction(&otlpprofiles.Function{}, &sharedState).SetSystemNameStrindex(int32(1)) }) } -func TestFunction_SystemName(t *testing.T) { +func TestFunction_FilenameStrindex(t *testing.T) { ms := NewFunction() - assert.Equal(t, int64(0), ms.SystemName()) - ms.SetSystemName(int64(1)) - assert.Equal(t, int64(1), ms.SystemName()) + assert.Equal(t, int32(0), ms.FilenameStrindex()) + ms.SetFilenameStrindex(int32(1)) + assert.Equal(t, int32(1), ms.FilenameStrindex()) sharedState := internal.StateReadOnly - assert.Panics(t, func() { newFunction(&otlpprofiles.Function{}, &sharedState).SetSystemName(int64(1)) }) -} - -func TestFunction_Filename(t *testing.T) { - ms := NewFunction() - assert.Equal(t, int64(0), ms.Filename()) - ms.SetFilename(int64(1)) - assert.Equal(t, int64(1), ms.Filename()) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { newFunction(&otlpprofiles.Function{}, &sharedState).SetFilename(int64(1)) }) + assert.Panics(t, func() { newFunction(&otlpprofiles.Function{}, &sharedState).SetFilenameStrindex(int32(1)) }) } func TestFunction_StartLine(t *testing.T) { @@ -90,9 +81,8 @@ func generateTestFunction() Function { } func fillTestFunction(tv Function) { - tv.orig.Id = uint64(1) - tv.orig.Name = int64(1) - tv.orig.SystemName = int64(1) - tv.orig.Filename = int64(1) + tv.orig.NameStrindex = int32(1) + tv.orig.SystemNameStrindex = int32(1) + tv.orig.FilenameStrindex = int32(1) tv.orig.StartLine = int64(1) } diff --git a/pdata/pprofile/generated_functionslice.go b/pdata/pprofile/generated_functionslice.go index 9c295899efd..51dd4f2aca1 100644 --- a/pdata/pprofile/generated_functionslice.go +++ b/pdata/pprofile/generated_functionslice.go @@ -10,7 +10,7 @@ import ( "sort" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) // FunctionSlice logically represents a slice of Function. diff --git a/pdata/pprofile/generated_functionslice_test.go b/pdata/pprofile/generated_functionslice_test.go index e83a4d9a530..1fd9fd46be2 100644 --- a/pdata/pprofile/generated_functionslice_test.go +++ b/pdata/pprofile/generated_functionslice_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) func TestFunctionSlice(t *testing.T) { diff --git a/pdata/pprofile/generated_label.go b/pdata/pprofile/generated_label.go deleted file mode 100644 index fc93d13b390..00000000000 --- a/pdata/pprofile/generated_label.go +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "make genpdata". - -package pprofile - -import ( - "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" -) - -// Label provided additional context for a sample -// -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewLabel function to create new instances. -// Important: zero-initialized instance is not valid for use. -type Label struct { - orig *otlpprofiles.Label - state *internal.State -} - -func newLabel(orig *otlpprofiles.Label, state *internal.State) Label { - return Label{orig: orig, state: state} -} - -// NewLabel creates a new empty Label. -// -// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, -// OR directly access the member if this is embedded in another struct. -func NewLabel() Label { - state := internal.StateMutable - return newLabel(&otlpprofiles.Label{}, &state) -} - -// MoveTo moves all properties from the current struct overriding the destination and -// resetting the current instance to its zero value -func (ms Label) MoveTo(dest Label) { - ms.state.AssertMutable() - dest.state.AssertMutable() - *dest.orig = *ms.orig - *ms.orig = otlpprofiles.Label{} -} - -// Key returns the key associated with this Label. -func (ms Label) Key() int64 { - return ms.orig.Key -} - -// SetKey replaces the key associated with this Label. -func (ms Label) SetKey(v int64) { - ms.state.AssertMutable() - ms.orig.Key = v -} - -// Str returns the str associated with this Label. -func (ms Label) Str() int64 { - return ms.orig.Str -} - -// SetStr replaces the str associated with this Label. -func (ms Label) SetStr(v int64) { - ms.state.AssertMutable() - ms.orig.Str = v -} - -// Num returns the num associated with this Label. -func (ms Label) Num() int64 { - return ms.orig.Num -} - -// SetNum replaces the num associated with this Label. -func (ms Label) SetNum(v int64) { - ms.state.AssertMutable() - ms.orig.Num = v -} - -// NumUnit returns the numunit associated with this Label. -func (ms Label) NumUnit() int64 { - return ms.orig.NumUnit -} - -// SetNumUnit replaces the numunit associated with this Label. -func (ms Label) SetNumUnit(v int64) { - ms.state.AssertMutable() - ms.orig.NumUnit = v -} - -// CopyTo copies all properties from the current struct overriding the destination. -func (ms Label) CopyTo(dest Label) { - dest.state.AssertMutable() - dest.SetKey(ms.Key()) - dest.SetStr(ms.Str()) - dest.SetNum(ms.Num()) - dest.SetNumUnit(ms.NumUnit()) -} diff --git a/pdata/pprofile/generated_label_test.go b/pdata/pprofile/generated_label_test.go deleted file mode 100644 index c4ed6722376..00000000000 --- a/pdata/pprofile/generated_label_test.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "make genpdata". - -package pprofile - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" -) - -func TestLabel_MoveTo(t *testing.T) { - ms := generateTestLabel() - dest := NewLabel() - ms.MoveTo(dest) - assert.Equal(t, NewLabel(), ms) - assert.Equal(t, generateTestLabel(), dest) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { ms.MoveTo(newLabel(&otlpprofiles.Label{}, &sharedState)) }) - assert.Panics(t, func() { newLabel(&otlpprofiles.Label{}, &sharedState).MoveTo(dest) }) -} - -func TestLabel_CopyTo(t *testing.T) { - ms := NewLabel() - orig := NewLabel() - orig.CopyTo(ms) - assert.Equal(t, orig, ms) - orig = generateTestLabel() - orig.CopyTo(ms) - assert.Equal(t, orig, ms) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { ms.CopyTo(newLabel(&otlpprofiles.Label{}, &sharedState)) }) -} - -func TestLabel_Key(t *testing.T) { - ms := NewLabel() - assert.Equal(t, int64(0), ms.Key()) - ms.SetKey(int64(1)) - assert.Equal(t, int64(1), ms.Key()) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { newLabel(&otlpprofiles.Label{}, &sharedState).SetKey(int64(1)) }) -} - -func TestLabel_Str(t *testing.T) { - ms := NewLabel() - assert.Equal(t, int64(0), ms.Str()) - ms.SetStr(int64(1)) - assert.Equal(t, int64(1), ms.Str()) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { newLabel(&otlpprofiles.Label{}, &sharedState).SetStr(int64(1)) }) -} - -func TestLabel_Num(t *testing.T) { - ms := NewLabel() - assert.Equal(t, int64(0), ms.Num()) - ms.SetNum(int64(1)) - assert.Equal(t, int64(1), ms.Num()) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { newLabel(&otlpprofiles.Label{}, &sharedState).SetNum(int64(1)) }) -} - -func TestLabel_NumUnit(t *testing.T) { - ms := NewLabel() - assert.Equal(t, int64(0), ms.NumUnit()) - ms.SetNumUnit(int64(1)) - assert.Equal(t, int64(1), ms.NumUnit()) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { newLabel(&otlpprofiles.Label{}, &sharedState).SetNumUnit(int64(1)) }) -} - -func generateTestLabel() Label { - tv := NewLabel() - fillTestLabel(tv) - return tv -} - -func fillTestLabel(tv Label) { - tv.orig.Key = int64(1) - tv.orig.Str = int64(1) - tv.orig.Num = int64(1) - tv.orig.NumUnit = int64(1) -} diff --git a/pdata/pprofile/generated_line.go b/pdata/pprofile/generated_line.go index 80147d393a5..daae7435237 100644 --- a/pdata/pprofile/generated_line.go +++ b/pdata/pprofile/generated_line.go @@ -8,7 +8,7 @@ package pprofile import ( "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) // Line details a specific line in a source code, linked to a function. @@ -46,12 +46,12 @@ func (ms Line) MoveTo(dest Line) { } // FunctionIndex returns the functionindex associated with this Line. -func (ms Line) FunctionIndex() uint64 { +func (ms Line) FunctionIndex() int32 { return ms.orig.FunctionIndex } // SetFunctionIndex replaces the functionindex associated with this Line. -func (ms Line) SetFunctionIndex(v uint64) { +func (ms Line) SetFunctionIndex(v int32) { ms.state.AssertMutable() ms.orig.FunctionIndex = v } diff --git a/pdata/pprofile/generated_line_test.go b/pdata/pprofile/generated_line_test.go index aef0f583145..3a7c50b1e9d 100644 --- a/pdata/pprofile/generated_line_test.go +++ b/pdata/pprofile/generated_line_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) func TestLine_MoveTo(t *testing.T) { @@ -40,11 +40,11 @@ func TestLine_CopyTo(t *testing.T) { func TestLine_FunctionIndex(t *testing.T) { ms := NewLine() - assert.Equal(t, uint64(0), ms.FunctionIndex()) - ms.SetFunctionIndex(uint64(1)) - assert.Equal(t, uint64(1), ms.FunctionIndex()) + assert.Equal(t, int32(0), ms.FunctionIndex()) + ms.SetFunctionIndex(int32(1)) + assert.Equal(t, int32(1), ms.FunctionIndex()) sharedState := internal.StateReadOnly - assert.Panics(t, func() { newLine(&otlpprofiles.Line{}, &sharedState).SetFunctionIndex(uint64(1)) }) + assert.Panics(t, func() { newLine(&otlpprofiles.Line{}, &sharedState).SetFunctionIndex(int32(1)) }) } func TestLine_Line(t *testing.T) { @@ -72,7 +72,7 @@ func generateTestLine() Line { } func fillTestLine(tv Line) { - tv.orig.FunctionIndex = uint64(1) + tv.orig.FunctionIndex = int32(1) tv.orig.Line = int64(1) tv.orig.Column = int64(1) } diff --git a/pdata/pprofile/generated_lineslice.go b/pdata/pprofile/generated_lineslice.go index 3f8daed79e9..d5b94978bb5 100644 --- a/pdata/pprofile/generated_lineslice.go +++ b/pdata/pprofile/generated_lineslice.go @@ -10,7 +10,7 @@ import ( "sort" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) // LineSlice logically represents a slice of Line. diff --git a/pdata/pprofile/generated_lineslice_test.go b/pdata/pprofile/generated_lineslice_test.go index fd53c0237a0..afa5dbb20f5 100644 --- a/pdata/pprofile/generated_lineslice_test.go +++ b/pdata/pprofile/generated_lineslice_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) func TestLineSlice(t *testing.T) { diff --git a/pdata/pprofile/generated_link.go b/pdata/pprofile/generated_link.go index 70af00112b0..22966f15545 100644 --- a/pdata/pprofile/generated_link.go +++ b/pdata/pprofile/generated_link.go @@ -9,7 +9,7 @@ package pprofile import ( "go.opentelemetry.io/collector/pdata/internal" "go.opentelemetry.io/collector/pdata/internal/data" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" "go.opentelemetry.io/collector/pdata/pcommon" ) diff --git a/pdata/pprofile/generated_link_test.go b/pdata/pprofile/generated_link_test.go index 8e10072d2dd..1def31638fe 100644 --- a/pdata/pprofile/generated_link_test.go +++ b/pdata/pprofile/generated_link_test.go @@ -13,7 +13,7 @@ import ( "go.opentelemetry.io/collector/pdata/internal" "go.opentelemetry.io/collector/pdata/internal/data" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" "go.opentelemetry.io/collector/pdata/pcommon" ) diff --git a/pdata/pprofile/generated_linkslice.go b/pdata/pprofile/generated_linkslice.go index dca0febad1b..b2a7a1ab211 100644 --- a/pdata/pprofile/generated_linkslice.go +++ b/pdata/pprofile/generated_linkslice.go @@ -10,7 +10,7 @@ import ( "sort" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) // LinkSlice logically represents a slice of Link. diff --git a/pdata/pprofile/generated_linkslice_test.go b/pdata/pprofile/generated_linkslice_test.go index bec39e870c8..269cc80680d 100644 --- a/pdata/pprofile/generated_linkslice_test.go +++ b/pdata/pprofile/generated_linkslice_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) func TestLinkSlice(t *testing.T) { diff --git a/pdata/pprofile/generated_location.go b/pdata/pprofile/generated_location.go index 5ed030f6d6d..8b968f973b9 100644 --- a/pdata/pprofile/generated_location.go +++ b/pdata/pprofile/generated_location.go @@ -8,7 +8,7 @@ package pprofile import ( "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -46,26 +46,27 @@ func (ms Location) MoveTo(dest Location) { *ms.orig = otlpprofiles.Location{} } -// ID returns the id associated with this Location. -func (ms Location) ID() uint64 { - return ms.orig.Id +// MappingIndex returns the mappingindex associated with this Location. +func (ms Location) MappingIndex() int32 { + return ms.orig.GetMappingIndex() } -// SetID replaces the id associated with this Location. -func (ms Location) SetID(v uint64) { - ms.state.AssertMutable() - ms.orig.Id = v +// HasMappingIndex returns true if the Location contains a +// MappingIndex value, false otherwise. +func (ms Location) HasMappingIndex() bool { + return ms.orig.MappingIndex_ != nil } -// MappingIndex returns the mappingindex associated with this Location. -func (ms Location) MappingIndex() uint64 { - return ms.orig.MappingIndex +// SetMappingIndex replaces the mappingindex associated with this Location. +func (ms Location) SetMappingIndex(v int32) { + ms.state.AssertMutable() + ms.orig.MappingIndex_ = &otlpprofiles.Location_MappingIndex{MappingIndex: v} } -// SetMappingIndex replaces the mappingindex associated with this Location. -func (ms Location) SetMappingIndex(v uint64) { +// RemoveMappingIndex removes the mappingindex associated with this Location. +func (ms Location) RemoveMappingIndex() { ms.state.AssertMutable() - ms.orig.MappingIndex = v + ms.orig.MappingIndex_ = nil } // Address returns the address associated with this Location. @@ -95,30 +96,20 @@ func (ms Location) SetIsFolded(v bool) { ms.orig.IsFolded = v } -// TypeIndex returns the typeindex associated with this Location. -func (ms Location) TypeIndex() uint32 { - return ms.orig.TypeIndex -} - -// SetTypeIndex replaces the typeindex associated with this Location. -func (ms Location) SetTypeIndex(v uint32) { - ms.state.AssertMutable() - ms.orig.TypeIndex = v -} - -// Attributes returns the Attributes associated with this Location. -func (ms Location) Attributes() pcommon.UInt64Slice { - return pcommon.UInt64Slice(internal.NewUInt64Slice(&ms.orig.Attributes, ms.state)) +// AttributeIndices returns the AttributeIndices associated with this Location. +func (ms Location) AttributeIndices() pcommon.Int32Slice { + return pcommon.Int32Slice(internal.NewInt32Slice(&ms.orig.AttributeIndices, ms.state)) } // CopyTo copies all properties from the current struct overriding the destination. func (ms Location) CopyTo(dest Location) { dest.state.AssertMutable() - dest.SetID(ms.ID()) - dest.SetMappingIndex(ms.MappingIndex()) + if ms.HasMappingIndex() { + dest.SetMappingIndex(ms.MappingIndex()) + } + dest.SetAddress(ms.Address()) ms.Line().CopyTo(dest.Line()) dest.SetIsFolded(ms.IsFolded()) - dest.SetTypeIndex(ms.TypeIndex()) - ms.Attributes().CopyTo(dest.Attributes()) + ms.AttributeIndices().CopyTo(dest.AttributeIndices()) } diff --git a/pdata/pprofile/generated_location_test.go b/pdata/pprofile/generated_location_test.go index fc20d72edcc..f1d9266245d 100644 --- a/pdata/pprofile/generated_location_test.go +++ b/pdata/pprofile/generated_location_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -39,22 +39,14 @@ func TestLocation_CopyTo(t *testing.T) { assert.Panics(t, func() { ms.CopyTo(newLocation(&otlpprofiles.Location{}, &sharedState)) }) } -func TestLocation_ID(t *testing.T) { - ms := NewLocation() - assert.Equal(t, uint64(0), ms.ID()) - ms.SetID(uint64(1)) - assert.Equal(t, uint64(1), ms.ID()) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { newLocation(&otlpprofiles.Location{}, &sharedState).SetID(uint64(1)) }) -} - func TestLocation_MappingIndex(t *testing.T) { ms := NewLocation() - assert.Equal(t, uint64(0), ms.MappingIndex()) - ms.SetMappingIndex(uint64(1)) - assert.Equal(t, uint64(1), ms.MappingIndex()) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { newLocation(&otlpprofiles.Location{}, &sharedState).SetMappingIndex(uint64(1)) }) + assert.Equal(t, int32(0), ms.MappingIndex()) + ms.SetMappingIndex(int32(1)) + assert.True(t, ms.HasMappingIndex()) + assert.Equal(t, int32(1), ms.MappingIndex()) + ms.RemoveMappingIndex() + assert.False(t, ms.HasMappingIndex()) } func TestLocation_Address(t *testing.T) { @@ -82,20 +74,11 @@ func TestLocation_IsFolded(t *testing.T) { assert.Panics(t, func() { newLocation(&otlpprofiles.Location{}, &sharedState).SetIsFolded(true) }) } -func TestLocation_TypeIndex(t *testing.T) { - ms := NewLocation() - assert.Equal(t, uint32(0), ms.TypeIndex()) - ms.SetTypeIndex(uint32(1)) - assert.Equal(t, uint32(1), ms.TypeIndex()) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { newLocation(&otlpprofiles.Location{}, &sharedState).SetTypeIndex(uint32(1)) }) -} - -func TestLocation_Attributes(t *testing.T) { +func TestLocation_AttributeIndices(t *testing.T) { ms := NewLocation() - assert.Equal(t, pcommon.NewUInt64Slice(), ms.Attributes()) - internal.FillTestUInt64Slice(internal.UInt64Slice(ms.Attributes())) - assert.Equal(t, pcommon.UInt64Slice(internal.GenerateTestUInt64Slice()), ms.Attributes()) + assert.Equal(t, pcommon.NewInt32Slice(), ms.AttributeIndices()) + internal.FillTestInt32Slice(internal.Int32Slice(ms.AttributeIndices())) + assert.Equal(t, pcommon.Int32Slice(internal.GenerateTestInt32Slice()), ms.AttributeIndices()) } func generateTestLocation() Location { @@ -105,11 +88,9 @@ func generateTestLocation() Location { } func fillTestLocation(tv Location) { - tv.orig.Id = uint64(1) - tv.orig.MappingIndex = uint64(1) + tv.orig.MappingIndex_ = &otlpprofiles.Location_MappingIndex{MappingIndex: int32(1)} tv.orig.Address = uint64(1) fillTestLineSlice(newLineSlice(&tv.orig.Line, tv.state)) tv.orig.IsFolded = true - tv.orig.TypeIndex = uint32(1) - internal.FillTestUInt64Slice(internal.NewUInt64Slice(&tv.orig.Attributes, tv.state)) + internal.FillTestInt32Slice(internal.NewInt32Slice(&tv.orig.AttributeIndices, tv.state)) } diff --git a/pdata/pprofile/generated_locationslice.go b/pdata/pprofile/generated_locationslice.go index 4848a46d925..42039af4ebe 100644 --- a/pdata/pprofile/generated_locationslice.go +++ b/pdata/pprofile/generated_locationslice.go @@ -10,7 +10,7 @@ import ( "sort" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) // LocationSlice logically represents a slice of Location. diff --git a/pdata/pprofile/generated_locationslice_test.go b/pdata/pprofile/generated_locationslice_test.go index e654bb88a1d..cdf2ebeba9e 100644 --- a/pdata/pprofile/generated_locationslice_test.go +++ b/pdata/pprofile/generated_locationslice_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) func TestLocationSlice(t *testing.T) { diff --git a/pdata/pprofile/generated_mapping.go b/pdata/pprofile/generated_mapping.go index 66c7cd165df..65ef57fa4db 100644 --- a/pdata/pprofile/generated_mapping.go +++ b/pdata/pprofile/generated_mapping.go @@ -8,7 +8,7 @@ package pprofile import ( "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -46,17 +46,6 @@ func (ms Mapping) MoveTo(dest Mapping) { *ms.orig = otlpprofiles.Mapping{} } -// ID returns the id associated with this Mapping. -func (ms Mapping) ID() uint64 { - return ms.orig.Id -} - -// SetID replaces the id associated with this Mapping. -func (ms Mapping) SetID(v uint64) { - ms.state.AssertMutable() - ms.orig.Id = v -} - // MemoryStart returns the memorystart associated with this Mapping. func (ms Mapping) MemoryStart() uint64 { return ms.orig.MemoryStart @@ -90,42 +79,20 @@ func (ms Mapping) SetFileOffset(v uint64) { ms.orig.FileOffset = v } -// Filename returns the filename associated with this Mapping. -func (ms Mapping) Filename() int64 { - return ms.orig.Filename -} - -// SetFilename replaces the filename associated with this Mapping. -func (ms Mapping) SetFilename(v int64) { - ms.state.AssertMutable() - ms.orig.Filename = v -} - -// BuildID returns the buildid associated with this Mapping. -func (ms Mapping) BuildID() int64 { - return ms.orig.BuildId -} - -// SetBuildID replaces the buildid associated with this Mapping. -func (ms Mapping) SetBuildID(v int64) { - ms.state.AssertMutable() - ms.orig.BuildId = v -} - -// BuildIDKind returns the buildidkind associated with this Mapping. -func (ms Mapping) BuildIDKind() otlpprofiles.BuildIdKind { - return ms.orig.BuildIdKind +// FilenameStrindex returns the filenamestrindex associated with this Mapping. +func (ms Mapping) FilenameStrindex() int32 { + return ms.orig.FilenameStrindex } -// SetBuildIDKind replaces the buildidkind associated with this Mapping. -func (ms Mapping) SetBuildIDKind(v otlpprofiles.BuildIdKind) { +// SetFilenameStrindex replaces the filenamestrindex associated with this Mapping. +func (ms Mapping) SetFilenameStrindex(v int32) { ms.state.AssertMutable() - ms.orig.BuildIdKind = v + ms.orig.FilenameStrindex = v } -// Attributes returns the Attributes associated with this Mapping. -func (ms Mapping) Attributes() pcommon.UInt64Slice { - return pcommon.UInt64Slice(internal.NewUInt64Slice(&ms.orig.Attributes, ms.state)) +// AttributeIndices returns the AttributeIndices associated with this Mapping. +func (ms Mapping) AttributeIndices() pcommon.Int32Slice { + return pcommon.Int32Slice(internal.NewInt32Slice(&ms.orig.AttributeIndices, ms.state)) } // HasFunctions returns the hasfunctions associated with this Mapping. @@ -175,14 +142,11 @@ func (ms Mapping) SetHasInlineFrames(v bool) { // CopyTo copies all properties from the current struct overriding the destination. func (ms Mapping) CopyTo(dest Mapping) { dest.state.AssertMutable() - dest.SetID(ms.ID()) dest.SetMemoryStart(ms.MemoryStart()) dest.SetMemoryLimit(ms.MemoryLimit()) dest.SetFileOffset(ms.FileOffset()) - dest.SetFilename(ms.Filename()) - dest.SetBuildID(ms.BuildID()) - dest.SetBuildIDKind(ms.BuildIDKind()) - ms.Attributes().CopyTo(dest.Attributes()) + dest.SetFilenameStrindex(ms.FilenameStrindex()) + ms.AttributeIndices().CopyTo(dest.AttributeIndices()) dest.SetHasFunctions(ms.HasFunctions()) dest.SetHasFilenames(ms.HasFilenames()) dest.SetHasLineNumbers(ms.HasLineNumbers()) diff --git a/pdata/pprofile/generated_mapping_test.go b/pdata/pprofile/generated_mapping_test.go index ab575615297..a2a8d033de5 100644 --- a/pdata/pprofile/generated_mapping_test.go +++ b/pdata/pprofile/generated_mapping_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -39,15 +39,6 @@ func TestMapping_CopyTo(t *testing.T) { assert.Panics(t, func() { ms.CopyTo(newMapping(&otlpprofiles.Mapping{}, &sharedState)) }) } -func TestMapping_ID(t *testing.T) { - ms := NewMapping() - assert.Equal(t, uint64(0), ms.ID()) - ms.SetID(uint64(1)) - assert.Equal(t, uint64(1), ms.ID()) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { newMapping(&otlpprofiles.Mapping{}, &sharedState).SetID(uint64(1)) }) -} - func TestMapping_MemoryStart(t *testing.T) { ms := NewMapping() assert.Equal(t, uint64(0), ms.MemoryStart()) @@ -75,38 +66,20 @@ func TestMapping_FileOffset(t *testing.T) { assert.Panics(t, func() { newMapping(&otlpprofiles.Mapping{}, &sharedState).SetFileOffset(uint64(1)) }) } -func TestMapping_Filename(t *testing.T) { - ms := NewMapping() - assert.Equal(t, int64(0), ms.Filename()) - ms.SetFilename(int64(1)) - assert.Equal(t, int64(1), ms.Filename()) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { newMapping(&otlpprofiles.Mapping{}, &sharedState).SetFilename(int64(1)) }) -} - -func TestMapping_BuildID(t *testing.T) { - ms := NewMapping() - assert.Equal(t, int64(0), ms.BuildID()) - ms.SetBuildID(int64(1)) - assert.Equal(t, int64(1), ms.BuildID()) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { newMapping(&otlpprofiles.Mapping{}, &sharedState).SetBuildID(int64(1)) }) -} - -func TestMapping_BuildIDKind(t *testing.T) { +func TestMapping_FilenameStrindex(t *testing.T) { ms := NewMapping() - assert.Equal(t, otlpprofiles.BuildIdKind(0), ms.BuildIDKind()) - ms.SetBuildIDKind(otlpprofiles.BuildIdKind(1)) - assert.Equal(t, otlpprofiles.BuildIdKind(1), ms.BuildIDKind()) + assert.Equal(t, int32(0), ms.FilenameStrindex()) + ms.SetFilenameStrindex(int32(1)) + assert.Equal(t, int32(1), ms.FilenameStrindex()) sharedState := internal.StateReadOnly - assert.Panics(t, func() { newMapping(&otlpprofiles.Mapping{}, &sharedState).SetBuildIDKind(otlpprofiles.BuildIdKind(1)) }) + assert.Panics(t, func() { newMapping(&otlpprofiles.Mapping{}, &sharedState).SetFilenameStrindex(int32(1)) }) } -func TestMapping_Attributes(t *testing.T) { +func TestMapping_AttributeIndices(t *testing.T) { ms := NewMapping() - assert.Equal(t, pcommon.NewUInt64Slice(), ms.Attributes()) - internal.FillTestUInt64Slice(internal.UInt64Slice(ms.Attributes())) - assert.Equal(t, pcommon.UInt64Slice(internal.GenerateTestUInt64Slice()), ms.Attributes()) + assert.Equal(t, pcommon.NewInt32Slice(), ms.AttributeIndices()) + internal.FillTestInt32Slice(internal.Int32Slice(ms.AttributeIndices())) + assert.Equal(t, pcommon.Int32Slice(internal.GenerateTestInt32Slice()), ms.AttributeIndices()) } func TestMapping_HasFunctions(t *testing.T) { @@ -152,14 +125,11 @@ func generateTestMapping() Mapping { } func fillTestMapping(tv Mapping) { - tv.orig.Id = uint64(1) tv.orig.MemoryStart = uint64(1) tv.orig.MemoryLimit = uint64(1) tv.orig.FileOffset = uint64(1) - tv.orig.Filename = int64(1) - tv.orig.BuildId = int64(1) - tv.orig.BuildIdKind = otlpprofiles.BuildIdKind(1) - internal.FillTestUInt64Slice(internal.NewUInt64Slice(&tv.orig.Attributes, tv.state)) + tv.orig.FilenameStrindex = int32(1) + internal.FillTestInt32Slice(internal.NewInt32Slice(&tv.orig.AttributeIndices, tv.state)) tv.orig.HasFunctions = true tv.orig.HasFilenames = true tv.orig.HasLineNumbers = true diff --git a/pdata/pprofile/generated_mappingslice.go b/pdata/pprofile/generated_mappingslice.go index 140d76f4854..af20e2dc4fc 100644 --- a/pdata/pprofile/generated_mappingslice.go +++ b/pdata/pprofile/generated_mappingslice.go @@ -10,7 +10,7 @@ import ( "sort" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) // MappingSlice logically represents a slice of Mapping. diff --git a/pdata/pprofile/generated_mappingslice_test.go b/pdata/pprofile/generated_mappingslice_test.go index a1c46aa0b9b..e9b27f598e2 100644 --- a/pdata/pprofile/generated_mappingslice_test.go +++ b/pdata/pprofile/generated_mappingslice_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) func TestMappingSlice(t *testing.T) { diff --git a/pdata/pprofile/generated_profile.go b/pdata/pprofile/generated_profile.go index 38f1cf3f0f3..c2c83070b37 100644 --- a/pdata/pprofile/generated_profile.go +++ b/pdata/pprofile/generated_profile.go @@ -8,7 +8,8 @@ package pprofile import ( "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + "go.opentelemetry.io/collector/pdata/internal/data" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -56,29 +57,29 @@ func (ms Profile) Sample() SampleSlice { return newSampleSlice(&ms.orig.Sample, ms.state) } -// Mapping returns the Mapping associated with this Profile. -func (ms Profile) Mapping() MappingSlice { - return newMappingSlice(&ms.orig.Mapping, ms.state) +// MappingTable returns the MappingTable associated with this Profile. +func (ms Profile) MappingTable() MappingSlice { + return newMappingSlice(&ms.orig.MappingTable, ms.state) } -// Location returns the Location associated with this Profile. -func (ms Profile) Location() LocationSlice { - return newLocationSlice(&ms.orig.Location, ms.state) +// LocationTable returns the LocationTable associated with this Profile. +func (ms Profile) LocationTable() LocationSlice { + return newLocationSlice(&ms.orig.LocationTable, ms.state) } // LocationIndices returns the LocationIndices associated with this Profile. -func (ms Profile) LocationIndices() pcommon.Int64Slice { - return pcommon.Int64Slice(internal.NewInt64Slice(&ms.orig.LocationIndices, ms.state)) +func (ms Profile) LocationIndices() pcommon.Int32Slice { + return pcommon.Int32Slice(internal.NewInt32Slice(&ms.orig.LocationIndices, ms.state)) } -// Function returns the Function associated with this Profile. -func (ms Profile) Function() FunctionSlice { - return newFunctionSlice(&ms.orig.Function, ms.state) +// FunctionTable returns the FunctionTable associated with this Profile. +func (ms Profile) FunctionTable() FunctionSlice { + return newFunctionSlice(&ms.orig.FunctionTable, ms.state) } // AttributeTable returns the AttributeTable associated with this Profile. -func (ms Profile) AttributeTable() pcommon.Map { - return pcommon.Map(internal.NewMap(&ms.orig.AttributeTable, ms.state)) +func (ms Profile) AttributeTable() AttributeTableSlice { + return newAttributeTableSlice(&ms.orig.AttributeTable, ms.state) } // AttributeUnits returns the AttributeUnits associated with this Profile. @@ -96,26 +97,26 @@ func (ms Profile) StringTable() pcommon.StringSlice { return pcommon.StringSlice(internal.NewStringSlice(&ms.orig.StringTable, ms.state)) } -// DropFrames returns the dropframes associated with this Profile. -func (ms Profile) DropFrames() int64 { - return ms.orig.DropFrames +// Time returns the time associated with this Profile. +func (ms Profile) Time() pcommon.Timestamp { + return pcommon.Timestamp(ms.orig.TimeNanos) } -// SetDropFrames replaces the dropframes associated with this Profile. -func (ms Profile) SetDropFrames(v int64) { +// SetTime replaces the time associated with this Profile. +func (ms Profile) SetTime(v pcommon.Timestamp) { ms.state.AssertMutable() - ms.orig.DropFrames = v + ms.orig.TimeNanos = int64(v) } -// KeepFrames returns the keepframes associated with this Profile. -func (ms Profile) KeepFrames() int64 { - return ms.orig.KeepFrames +// Duration returns the duration associated with this Profile. +func (ms Profile) Duration() pcommon.Timestamp { + return pcommon.Timestamp(ms.orig.DurationNanos) } -// SetKeepFrames replaces the keepframes associated with this Profile. -func (ms Profile) SetKeepFrames(v int64) { +// SetDuration replaces the duration associated with this Profile. +func (ms Profile) SetDuration(v pcommon.Timestamp) { ms.state.AssertMutable() - ms.orig.KeepFrames = v + ms.orig.DurationNanos = int64(v) } // StartTime returns the starttime associated with this Profile. @@ -129,17 +130,6 @@ func (ms Profile) SetStartTime(v pcommon.Timestamp) { ms.orig.TimeNanos = int64(v) } -// Duration returns the duration associated with this Profile. -func (ms Profile) Duration() pcommon.Timestamp { - return pcommon.Timestamp(ms.orig.DurationNanos) -} - -// SetDuration replaces the duration associated with this Profile. -func (ms Profile) SetDuration(v pcommon.Timestamp) { - ms.state.AssertMutable() - ms.orig.DurationNanos = int64(v) -} - // PeriodType returns the periodtype associated with this Profile. func (ms Profile) PeriodType() ValueType { return newValueType(&ms.orig.PeriodType, ms.state) @@ -156,20 +146,63 @@ func (ms Profile) SetPeriod(v int64) { ms.orig.Period = v } -// Comment returns the Comment associated with this Profile. -func (ms Profile) Comment() pcommon.Int64Slice { - return pcommon.Int64Slice(internal.NewInt64Slice(&ms.orig.Comment, ms.state)) +// CommentStrindices returns the CommentStrindices associated with this Profile. +func (ms Profile) CommentStrindices() pcommon.Int32Slice { + return pcommon.Int32Slice(internal.NewInt32Slice(&ms.orig.CommentStrindices, ms.state)) +} + +// DefaultSampleTypeStrindex returns the defaultsampletypestrindex associated with this Profile. +func (ms Profile) DefaultSampleTypeStrindex() int32 { + return ms.orig.DefaultSampleTypeStrindex +} + +// SetDefaultSampleTypeStrindex replaces the defaultsampletypestrindex associated with this Profile. +func (ms Profile) SetDefaultSampleTypeStrindex(v int32) { + ms.state.AssertMutable() + ms.orig.DefaultSampleTypeStrindex = v +} + +// ProfileID returns the profileid associated with this Profile. +func (ms Profile) ProfileID() ProfileID { + return ProfileID(ms.orig.ProfileId) +} + +// SetProfileID replaces the profileid associated with this Profile. +func (ms Profile) SetProfileID(v ProfileID) { + ms.state.AssertMutable() + ms.orig.ProfileId = data.ProfileID(v) +} + +// Attributes returns the Attributes associated with this Profile. +func (ms Profile) Attributes() pcommon.Map { + return pcommon.Map(internal.NewMap(&ms.orig.Attributes, ms.state)) +} + +// DroppedAttributesCount returns the droppedattributescount associated with this Profile. +func (ms Profile) DroppedAttributesCount() uint32 { + return ms.orig.DroppedAttributesCount +} + +// SetDroppedAttributesCount replaces the droppedattributescount associated with this Profile. +func (ms Profile) SetDroppedAttributesCount(v uint32) { + ms.state.AssertMutable() + ms.orig.DroppedAttributesCount = v } -// DefaultSampleType returns the defaultsampletype associated with this Profile. -func (ms Profile) DefaultSampleType() int64 { - return ms.orig.DefaultSampleType +// OriginalPayloadFormat returns the originalpayloadformat associated with this Profile. +func (ms Profile) OriginalPayloadFormat() string { + return ms.orig.OriginalPayloadFormat } -// SetDefaultSampleType replaces the defaultsampletype associated with this Profile. -func (ms Profile) SetDefaultSampleType(v int64) { +// SetOriginalPayloadFormat replaces the originalpayloadformat associated with this Profile. +func (ms Profile) SetOriginalPayloadFormat(v string) { ms.state.AssertMutable() - ms.orig.DefaultSampleType = v + ms.orig.OriginalPayloadFormat = v +} + +// OriginalPayload returns the OriginalPayload associated with this Profile. +func (ms Profile) OriginalPayload() pcommon.ByteSlice { + return pcommon.ByteSlice(internal.NewByteSlice(&ms.orig.OriginalPayload, ms.state)) } // CopyTo copies all properties from the current struct overriding the destination. @@ -177,20 +210,24 @@ func (ms Profile) CopyTo(dest Profile) { dest.state.AssertMutable() ms.SampleType().CopyTo(dest.SampleType()) ms.Sample().CopyTo(dest.Sample()) - ms.Mapping().CopyTo(dest.Mapping()) - ms.Location().CopyTo(dest.Location()) + ms.MappingTable().CopyTo(dest.MappingTable()) + ms.LocationTable().CopyTo(dest.LocationTable()) ms.LocationIndices().CopyTo(dest.LocationIndices()) - ms.Function().CopyTo(dest.Function()) + ms.FunctionTable().CopyTo(dest.FunctionTable()) ms.AttributeTable().CopyTo(dest.AttributeTable()) ms.AttributeUnits().CopyTo(dest.AttributeUnits()) ms.LinkTable().CopyTo(dest.LinkTable()) ms.StringTable().CopyTo(dest.StringTable()) - dest.SetDropFrames(ms.DropFrames()) - dest.SetKeepFrames(ms.KeepFrames()) - dest.SetStartTime(ms.StartTime()) + dest.SetTime(ms.Time()) dest.SetDuration(ms.Duration()) + dest.SetStartTime(ms.StartTime()) ms.PeriodType().CopyTo(dest.PeriodType()) dest.SetPeriod(ms.Period()) - ms.Comment().CopyTo(dest.Comment()) - dest.SetDefaultSampleType(ms.DefaultSampleType()) + ms.CommentStrindices().CopyTo(dest.CommentStrindices()) + dest.SetDefaultSampleTypeStrindex(ms.DefaultSampleTypeStrindex()) + dest.SetProfileID(ms.ProfileID()) + ms.Attributes().CopyTo(dest.Attributes()) + dest.SetDroppedAttributesCount(ms.DroppedAttributesCount()) + dest.SetOriginalPayloadFormat(ms.OriginalPayloadFormat()) + ms.OriginalPayload().CopyTo(dest.OriginalPayload()) } diff --git a/pdata/pprofile/generated_profile_test.go b/pdata/pprofile/generated_profile_test.go index e040f2c0dc4..df4720c90c4 100644 --- a/pdata/pprofile/generated_profile_test.go +++ b/pdata/pprofile/generated_profile_test.go @@ -12,7 +12,8 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + "go.opentelemetry.io/collector/pdata/internal/data" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -53,39 +54,39 @@ func TestProfile_Sample(t *testing.T) { assert.Equal(t, generateTestSampleSlice(), ms.Sample()) } -func TestProfile_Mapping(t *testing.T) { +func TestProfile_MappingTable(t *testing.T) { ms := NewProfile() - assert.Equal(t, NewMappingSlice(), ms.Mapping()) - fillTestMappingSlice(ms.Mapping()) - assert.Equal(t, generateTestMappingSlice(), ms.Mapping()) + assert.Equal(t, NewMappingSlice(), ms.MappingTable()) + fillTestMappingSlice(ms.MappingTable()) + assert.Equal(t, generateTestMappingSlice(), ms.MappingTable()) } -func TestProfile_Location(t *testing.T) { +func TestProfile_LocationTable(t *testing.T) { ms := NewProfile() - assert.Equal(t, NewLocationSlice(), ms.Location()) - fillTestLocationSlice(ms.Location()) - assert.Equal(t, generateTestLocationSlice(), ms.Location()) + assert.Equal(t, NewLocationSlice(), ms.LocationTable()) + fillTestLocationSlice(ms.LocationTable()) + assert.Equal(t, generateTestLocationSlice(), ms.LocationTable()) } func TestProfile_LocationIndices(t *testing.T) { ms := NewProfile() - assert.Equal(t, pcommon.NewInt64Slice(), ms.LocationIndices()) - internal.FillTestInt64Slice(internal.Int64Slice(ms.LocationIndices())) - assert.Equal(t, pcommon.Int64Slice(internal.GenerateTestInt64Slice()), ms.LocationIndices()) + assert.Equal(t, pcommon.NewInt32Slice(), ms.LocationIndices()) + internal.FillTestInt32Slice(internal.Int32Slice(ms.LocationIndices())) + assert.Equal(t, pcommon.Int32Slice(internal.GenerateTestInt32Slice()), ms.LocationIndices()) } -func TestProfile_Function(t *testing.T) { +func TestProfile_FunctionTable(t *testing.T) { ms := NewProfile() - assert.Equal(t, NewFunctionSlice(), ms.Function()) - fillTestFunctionSlice(ms.Function()) - assert.Equal(t, generateTestFunctionSlice(), ms.Function()) + assert.Equal(t, NewFunctionSlice(), ms.FunctionTable()) + fillTestFunctionSlice(ms.FunctionTable()) + assert.Equal(t, generateTestFunctionSlice(), ms.FunctionTable()) } func TestProfile_AttributeTable(t *testing.T) { ms := NewProfile() - assert.Equal(t, pcommon.NewMap(), ms.AttributeTable()) - internal.FillTestMap(internal.Map(ms.AttributeTable())) - assert.Equal(t, pcommon.Map(internal.GenerateTestMap()), ms.AttributeTable()) + assert.Equal(t, NewAttributeTableSlice(), ms.AttributeTable()) + fillTestAttributeTableSlice(ms.AttributeTable()) + assert.Equal(t, generateTestAttributeTableSlice(), ms.AttributeTable()) } func TestProfile_AttributeUnits(t *testing.T) { @@ -109,22 +110,20 @@ func TestProfile_StringTable(t *testing.T) { assert.Equal(t, pcommon.StringSlice(internal.GenerateTestStringSlice()), ms.StringTable()) } -func TestProfile_DropFrames(t *testing.T) { +func TestProfile_Time(t *testing.T) { ms := NewProfile() - assert.Equal(t, int64(0), ms.DropFrames()) - ms.SetDropFrames(int64(1)) - assert.Equal(t, int64(1), ms.DropFrames()) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { newProfile(&otlpprofiles.Profile{}, &sharedState).SetDropFrames(int64(1)) }) + assert.Equal(t, pcommon.Timestamp(0), ms.Time()) + testValTime := pcommon.Timestamp(1234567890) + ms.SetTime(testValTime) + assert.Equal(t, testValTime, ms.Time()) } -func TestProfile_KeepFrames(t *testing.T) { +func TestProfile_Duration(t *testing.T) { ms := NewProfile() - assert.Equal(t, int64(0), ms.KeepFrames()) - ms.SetKeepFrames(int64(1)) - assert.Equal(t, int64(1), ms.KeepFrames()) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { newProfile(&otlpprofiles.Profile{}, &sharedState).SetKeepFrames(int64(1)) }) + assert.Equal(t, pcommon.Timestamp(0), ms.Duration()) + testValDuration := pcommon.Timestamp(1234567890) + ms.SetDuration(testValDuration) + assert.Equal(t, testValDuration, ms.Duration()) } func TestProfile_StartTime(t *testing.T) { @@ -135,14 +134,6 @@ func TestProfile_StartTime(t *testing.T) { assert.Equal(t, testValStartTime, ms.StartTime()) } -func TestProfile_Duration(t *testing.T) { - ms := NewProfile() - assert.Equal(t, pcommon.Timestamp(0), ms.Duration()) - testValDuration := pcommon.Timestamp(1234567890) - ms.SetDuration(testValDuration) - assert.Equal(t, testValDuration, ms.Duration()) -} - func TestProfile_PeriodType(t *testing.T) { ms := NewProfile() fillTestValueType(ms.PeriodType()) @@ -158,20 +149,60 @@ func TestProfile_Period(t *testing.T) { assert.Panics(t, func() { newProfile(&otlpprofiles.Profile{}, &sharedState).SetPeriod(int64(1)) }) } -func TestProfile_Comment(t *testing.T) { +func TestProfile_CommentStrindices(t *testing.T) { ms := NewProfile() - assert.Equal(t, pcommon.NewInt64Slice(), ms.Comment()) - internal.FillTestInt64Slice(internal.Int64Slice(ms.Comment())) - assert.Equal(t, pcommon.Int64Slice(internal.GenerateTestInt64Slice()), ms.Comment()) + assert.Equal(t, pcommon.NewInt32Slice(), ms.CommentStrindices()) + internal.FillTestInt32Slice(internal.Int32Slice(ms.CommentStrindices())) + assert.Equal(t, pcommon.Int32Slice(internal.GenerateTestInt32Slice()), ms.CommentStrindices()) } -func TestProfile_DefaultSampleType(t *testing.T) { +func TestProfile_DefaultSampleTypeStrindex(t *testing.T) { ms := NewProfile() - assert.Equal(t, int64(0), ms.DefaultSampleType()) - ms.SetDefaultSampleType(int64(1)) - assert.Equal(t, int64(1), ms.DefaultSampleType()) + assert.Equal(t, int32(0), ms.DefaultSampleTypeStrindex()) + ms.SetDefaultSampleTypeStrindex(int32(1)) + assert.Equal(t, int32(1), ms.DefaultSampleTypeStrindex()) sharedState := internal.StateReadOnly - assert.Panics(t, func() { newProfile(&otlpprofiles.Profile{}, &sharedState).SetDefaultSampleType(int64(1)) }) + assert.Panics(t, func() { newProfile(&otlpprofiles.Profile{}, &sharedState).SetDefaultSampleTypeStrindex(int32(1)) }) +} + +func TestProfile_ProfileID(t *testing.T) { + ms := NewProfile() + assert.Equal(t, ProfileID(data.ProfileID([16]byte{})), ms.ProfileID()) + testValProfileID := ProfileID(data.ProfileID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1})) + ms.SetProfileID(testValProfileID) + assert.Equal(t, testValProfileID, ms.ProfileID()) +} + +func TestProfile_Attributes(t *testing.T) { + ms := NewProfile() + assert.Equal(t, pcommon.NewMap(), ms.Attributes()) + internal.FillTestMap(internal.Map(ms.Attributes())) + assert.Equal(t, pcommon.Map(internal.GenerateTestMap()), ms.Attributes()) +} + +func TestProfile_DroppedAttributesCount(t *testing.T) { + ms := NewProfile() + assert.Equal(t, uint32(0), ms.DroppedAttributesCount()) + ms.SetDroppedAttributesCount(uint32(17)) + assert.Equal(t, uint32(17), ms.DroppedAttributesCount()) + sharedState := internal.StateReadOnly + assert.Panics(t, func() { newProfile(&otlpprofiles.Profile{}, &sharedState).SetDroppedAttributesCount(uint32(17)) }) +} + +func TestProfile_OriginalPayloadFormat(t *testing.T) { + ms := NewProfile() + assert.Equal(t, "", ms.OriginalPayloadFormat()) + ms.SetOriginalPayloadFormat("original payload") + assert.Equal(t, "original payload", ms.OriginalPayloadFormat()) + sharedState := internal.StateReadOnly + assert.Panics(t, func() { newProfile(&otlpprofiles.Profile{}, &sharedState).SetOriginalPayloadFormat("original payload") }) +} + +func TestProfile_OriginalPayload(t *testing.T) { + ms := NewProfile() + assert.Equal(t, pcommon.NewByteSlice(), ms.OriginalPayload()) + internal.FillTestByteSlice(internal.ByteSlice(ms.OriginalPayload())) + assert.Equal(t, pcommon.ByteSlice(internal.GenerateTestByteSlice()), ms.OriginalPayload()) } func generateTestProfile() Profile { @@ -183,20 +214,24 @@ func generateTestProfile() Profile { func fillTestProfile(tv Profile) { fillTestValueTypeSlice(newValueTypeSlice(&tv.orig.SampleType, tv.state)) fillTestSampleSlice(newSampleSlice(&tv.orig.Sample, tv.state)) - fillTestMappingSlice(newMappingSlice(&tv.orig.Mapping, tv.state)) - fillTestLocationSlice(newLocationSlice(&tv.orig.Location, tv.state)) - internal.FillTestInt64Slice(internal.NewInt64Slice(&tv.orig.LocationIndices, tv.state)) - fillTestFunctionSlice(newFunctionSlice(&tv.orig.Function, tv.state)) - internal.FillTestMap(internal.NewMap(&tv.orig.AttributeTable, tv.state)) + fillTestMappingSlice(newMappingSlice(&tv.orig.MappingTable, tv.state)) + fillTestLocationSlice(newLocationSlice(&tv.orig.LocationTable, tv.state)) + internal.FillTestInt32Slice(internal.NewInt32Slice(&tv.orig.LocationIndices, tv.state)) + fillTestFunctionSlice(newFunctionSlice(&tv.orig.FunctionTable, tv.state)) + fillTestAttributeTableSlice(newAttributeTableSlice(&tv.orig.AttributeTable, tv.state)) fillTestAttributeUnitSlice(newAttributeUnitSlice(&tv.orig.AttributeUnits, tv.state)) fillTestLinkSlice(newLinkSlice(&tv.orig.LinkTable, tv.state)) internal.FillTestStringSlice(internal.NewStringSlice(&tv.orig.StringTable, tv.state)) - tv.orig.DropFrames = int64(1) - tv.orig.KeepFrames = int64(1) tv.orig.TimeNanos = 1234567890 tv.orig.DurationNanos = 1234567890 + tv.orig.TimeNanos = 1234567890 fillTestValueType(newValueType(&tv.orig.PeriodType, tv.state)) tv.orig.Period = int64(1) - internal.FillTestInt64Slice(internal.NewInt64Slice(&tv.orig.Comment, tv.state)) - tv.orig.DefaultSampleType = int64(1) + internal.FillTestInt32Slice(internal.NewInt32Slice(&tv.orig.CommentStrindices, tv.state)) + tv.orig.DefaultSampleTypeStrindex = int32(1) + tv.orig.ProfileId = data.ProfileID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1}) + internal.FillTestMap(internal.NewMap(&tv.orig.Attributes, tv.state)) + tv.orig.DroppedAttributesCount = uint32(17) + tv.orig.OriginalPayloadFormat = "original payload" + internal.FillTestByteSlice(internal.NewByteSlice(&tv.orig.OriginalPayload, tv.state)) } diff --git a/pdata/pprofile/generated_profilecontainer.go b/pdata/pprofile/generated_profilecontainer.go deleted file mode 100644 index 9f597728565..00000000000 --- a/pdata/pprofile/generated_profilecontainer.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "make genpdata". - -package pprofile - -import ( - "go.opentelemetry.io/collector/pdata/internal" - "go.opentelemetry.io/collector/pdata/internal/data" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" - "go.opentelemetry.io/collector/pdata/pcommon" -) - -// ProfileContainer are an experimental implementation of the OpenTelemetry Profiles Data Model. - -// This is a reference type, if passed by value and callee modifies it the -// caller will see the modification. -// -// Must use NewProfileContainer function to create new instances. -// Important: zero-initialized instance is not valid for use. -type ProfileContainer struct { - orig *otlpprofiles.ProfileContainer - state *internal.State -} - -func newProfileContainer(orig *otlpprofiles.ProfileContainer, state *internal.State) ProfileContainer { - return ProfileContainer{orig: orig, state: state} -} - -// NewProfileContainer creates a new empty ProfileContainer. -// -// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, -// OR directly access the member if this is embedded in another struct. -func NewProfileContainer() ProfileContainer { - state := internal.StateMutable - return newProfileContainer(&otlpprofiles.ProfileContainer{}, &state) -} - -// MoveTo moves all properties from the current struct overriding the destination and -// resetting the current instance to its zero value -func (ms ProfileContainer) MoveTo(dest ProfileContainer) { - ms.state.AssertMutable() - dest.state.AssertMutable() - *dest.orig = *ms.orig - *ms.orig = otlpprofiles.ProfileContainer{} -} - -// ProfileID returns the profileid associated with this ProfileContainer. -func (ms ProfileContainer) ProfileID() ProfileID { - return ProfileID(ms.orig.ProfileId) -} - -// SetProfileID replaces the profileid associated with this ProfileContainer. -func (ms ProfileContainer) SetProfileID(v ProfileID) { - ms.state.AssertMutable() - ms.orig.ProfileId = data.ProfileID(v) -} - -// StartTime returns the starttime associated with this ProfileContainer. -func (ms ProfileContainer) StartTime() pcommon.Timestamp { - return pcommon.Timestamp(ms.orig.StartTimeUnixNano) -} - -// SetStartTime replaces the starttime associated with this ProfileContainer. -func (ms ProfileContainer) SetStartTime(v pcommon.Timestamp) { - ms.state.AssertMutable() - ms.orig.StartTimeUnixNano = uint64(v) -} - -// EndTime returns the endtime associated with this ProfileContainer. -func (ms ProfileContainer) EndTime() pcommon.Timestamp { - return pcommon.Timestamp(ms.orig.EndTimeUnixNano) -} - -// SetEndTime replaces the endtime associated with this ProfileContainer. -func (ms ProfileContainer) SetEndTime(v pcommon.Timestamp) { - ms.state.AssertMutable() - ms.orig.EndTimeUnixNano = uint64(v) -} - -// Attributes returns the Attributes associated with this ProfileContainer. -func (ms ProfileContainer) Attributes() pcommon.Map { - return pcommon.Map(internal.NewMap(&ms.orig.Attributes, ms.state)) -} - -// DroppedAttributesCount returns the droppedattributescount associated with this ProfileContainer. -func (ms ProfileContainer) DroppedAttributesCount() uint32 { - return ms.orig.DroppedAttributesCount -} - -// SetDroppedAttributesCount replaces the droppedattributescount associated with this ProfileContainer. -func (ms ProfileContainer) SetDroppedAttributesCount(v uint32) { - ms.state.AssertMutable() - ms.orig.DroppedAttributesCount = v -} - -// Profile returns the profile associated with this ProfileContainer. -func (ms ProfileContainer) Profile() Profile { - return newProfile(&ms.orig.Profile, ms.state) -} - -// CopyTo copies all properties from the current struct overriding the destination. -func (ms ProfileContainer) CopyTo(dest ProfileContainer) { - dest.state.AssertMutable() - dest.SetProfileID(ms.ProfileID()) - dest.SetStartTime(ms.StartTime()) - dest.SetEndTime(ms.EndTime()) - ms.Attributes().CopyTo(dest.Attributes()) - dest.SetDroppedAttributesCount(ms.DroppedAttributesCount()) - ms.Profile().CopyTo(dest.Profile()) -} diff --git a/pdata/pprofile/generated_profilecontainer_test.go b/pdata/pprofile/generated_profilecontainer_test.go deleted file mode 100644 index 1af7282f3cf..00000000000 --- a/pdata/pprofile/generated_profilecontainer_test.go +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "make genpdata". - -package pprofile - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - "go.opentelemetry.io/collector/pdata/internal" - "go.opentelemetry.io/collector/pdata/internal/data" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" - "go.opentelemetry.io/collector/pdata/pcommon" -) - -func TestProfileContainer_MoveTo(t *testing.T) { - ms := generateTestProfileContainer() - dest := NewProfileContainer() - ms.MoveTo(dest) - assert.Equal(t, NewProfileContainer(), ms) - assert.Equal(t, generateTestProfileContainer(), dest) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { ms.MoveTo(newProfileContainer(&otlpprofiles.ProfileContainer{}, &sharedState)) }) - assert.Panics(t, func() { newProfileContainer(&otlpprofiles.ProfileContainer{}, &sharedState).MoveTo(dest) }) -} - -func TestProfileContainer_CopyTo(t *testing.T) { - ms := NewProfileContainer() - orig := NewProfileContainer() - orig.CopyTo(ms) - assert.Equal(t, orig, ms) - orig = generateTestProfileContainer() - orig.CopyTo(ms) - assert.Equal(t, orig, ms) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { ms.CopyTo(newProfileContainer(&otlpprofiles.ProfileContainer{}, &sharedState)) }) -} - -func TestProfileContainer_ProfileID(t *testing.T) { - ms := NewProfileContainer() - assert.Equal(t, ProfileID(data.ProfileID([16]byte{})), ms.ProfileID()) - testValProfileID := ProfileID(data.ProfileID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1})) - ms.SetProfileID(testValProfileID) - assert.Equal(t, testValProfileID, ms.ProfileID()) -} - -func TestProfileContainer_StartTime(t *testing.T) { - ms := NewProfileContainer() - assert.Equal(t, pcommon.Timestamp(0), ms.StartTime()) - testValStartTime := pcommon.Timestamp(1234567890) - ms.SetStartTime(testValStartTime) - assert.Equal(t, testValStartTime, ms.StartTime()) -} - -func TestProfileContainer_EndTime(t *testing.T) { - ms := NewProfileContainer() - assert.Equal(t, pcommon.Timestamp(0), ms.EndTime()) - testValEndTime := pcommon.Timestamp(1234567890) - ms.SetEndTime(testValEndTime) - assert.Equal(t, testValEndTime, ms.EndTime()) -} - -func TestProfileContainer_Attributes(t *testing.T) { - ms := NewProfileContainer() - assert.Equal(t, pcommon.NewMap(), ms.Attributes()) - internal.FillTestMap(internal.Map(ms.Attributes())) - assert.Equal(t, pcommon.Map(internal.GenerateTestMap()), ms.Attributes()) -} - -func TestProfileContainer_DroppedAttributesCount(t *testing.T) { - ms := NewProfileContainer() - assert.Equal(t, uint32(0), ms.DroppedAttributesCount()) - ms.SetDroppedAttributesCount(uint32(17)) - assert.Equal(t, uint32(17), ms.DroppedAttributesCount()) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { - newProfileContainer(&otlpprofiles.ProfileContainer{}, &sharedState).SetDroppedAttributesCount(uint32(17)) - }) -} - -func TestProfileContainer_Profile(t *testing.T) { - ms := NewProfileContainer() - fillTestProfile(ms.Profile()) - assert.Equal(t, generateTestProfile(), ms.Profile()) -} - -func generateTestProfileContainer() ProfileContainer { - tv := NewProfileContainer() - fillTestProfileContainer(tv) - return tv -} - -func fillTestProfileContainer(tv ProfileContainer) { - tv.orig.ProfileId = data.ProfileID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1}) - tv.orig.StartTimeUnixNano = 1234567890 - tv.orig.EndTimeUnixNano = 1234567890 - internal.FillTestMap(internal.NewMap(&tv.orig.Attributes, tv.state)) - tv.orig.DroppedAttributesCount = uint32(17) - fillTestProfile(newProfile(&tv.orig.Profile, tv.state)) -} diff --git a/pdata/pprofile/generated_profilescontainersslice_test.go b/pdata/pprofile/generated_profilescontainersslice_test.go deleted file mode 100644 index 902fd4cf24b..00000000000 --- a/pdata/pprofile/generated_profilescontainersslice_test.go +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by "pdata/internal/cmd/pdatagen/main.go". DO NOT EDIT. -// To regenerate this file run "make genpdata". - -package pprofile - -import ( - "testing" - "unsafe" - - "github.com/stretchr/testify/assert" - - "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" -) - -func TestProfilesContainersSlice(t *testing.T) { - es := NewProfilesContainersSlice() - assert.Equal(t, 0, es.Len()) - state := internal.StateMutable - es = newProfilesContainersSlice(&[]*otlpprofiles.ProfileContainer{}, &state) - assert.Equal(t, 0, es.Len()) - - emptyVal := NewProfileContainer() - testVal := generateTestProfileContainer() - for i := 0; i < 7; i++ { - el := es.AppendEmpty() - assert.Equal(t, emptyVal, es.At(i)) - fillTestProfileContainer(el) - assert.Equal(t, testVal, es.At(i)) - } - assert.Equal(t, 7, es.Len()) -} - -func TestProfilesContainersSliceReadOnly(t *testing.T) { - sharedState := internal.StateReadOnly - es := newProfilesContainersSlice(&[]*otlpprofiles.ProfileContainer{}, &sharedState) - assert.Equal(t, 0, es.Len()) - assert.Panics(t, func() { es.AppendEmpty() }) - assert.Panics(t, func() { es.EnsureCapacity(2) }) - es2 := NewProfilesContainersSlice() - es.CopyTo(es2) - assert.Panics(t, func() { es2.CopyTo(es) }) - assert.Panics(t, func() { es.MoveAndAppendTo(es2) }) - assert.Panics(t, func() { es2.MoveAndAppendTo(es) }) -} - -func TestProfilesContainersSlice_CopyTo(t *testing.T) { - dest := NewProfilesContainersSlice() - // Test CopyTo to empty - NewProfilesContainersSlice().CopyTo(dest) - assert.Equal(t, NewProfilesContainersSlice(), dest) - - // Test CopyTo larger slice - generateTestProfilesContainersSlice().CopyTo(dest) - assert.Equal(t, generateTestProfilesContainersSlice(), dest) - - // Test CopyTo same size slice - generateTestProfilesContainersSlice().CopyTo(dest) - assert.Equal(t, generateTestProfilesContainersSlice(), dest) -} - -func TestProfilesContainersSlice_EnsureCapacity(t *testing.T) { - es := generateTestProfilesContainersSlice() - - // Test ensure smaller capacity. - const ensureSmallLen = 4 - es.EnsureCapacity(ensureSmallLen) - assert.Less(t, ensureSmallLen, es.Len()) - assert.Equal(t, es.Len(), cap(*es.orig)) - assert.Equal(t, generateTestProfilesContainersSlice(), es) - - // Test ensure larger capacity - const ensureLargeLen = 9 - es.EnsureCapacity(ensureLargeLen) - assert.Less(t, generateTestProfilesContainersSlice().Len(), ensureLargeLen) - assert.Equal(t, ensureLargeLen, cap(*es.orig)) - assert.Equal(t, generateTestProfilesContainersSlice(), es) -} - -func TestProfilesContainersSlice_MoveAndAppendTo(t *testing.T) { - // Test MoveAndAppendTo to empty - expectedSlice := generateTestProfilesContainersSlice() - dest := NewProfilesContainersSlice() - src := generateTestProfilesContainersSlice() - src.MoveAndAppendTo(dest) - assert.Equal(t, generateTestProfilesContainersSlice(), dest) - assert.Equal(t, 0, src.Len()) - assert.Equal(t, expectedSlice.Len(), dest.Len()) - - // Test MoveAndAppendTo empty slice - src.MoveAndAppendTo(dest) - assert.Equal(t, generateTestProfilesContainersSlice(), dest) - assert.Equal(t, 0, src.Len()) - assert.Equal(t, expectedSlice.Len(), dest.Len()) - - // Test MoveAndAppendTo not empty slice - generateTestProfilesContainersSlice().MoveAndAppendTo(dest) - assert.Equal(t, 2*expectedSlice.Len(), dest.Len()) - for i := 0; i < expectedSlice.Len(); i++ { - assert.Equal(t, expectedSlice.At(i), dest.At(i)) - assert.Equal(t, expectedSlice.At(i), dest.At(i+expectedSlice.Len())) - } -} - -func TestProfilesContainersSlice_RemoveIf(t *testing.T) { - // Test RemoveIf on empty slice - emptySlice := NewProfilesContainersSlice() - emptySlice.RemoveIf(func(el ProfileContainer) bool { - t.Fail() - return false - }) - - // Test RemoveIf - filtered := generateTestProfilesContainersSlice() - pos := 0 - filtered.RemoveIf(func(el ProfileContainer) bool { - pos++ - return pos%3 == 0 - }) - assert.Equal(t, 5, filtered.Len()) -} - -func TestProfilesContainersSlice_Sort(t *testing.T) { - es := generateTestProfilesContainersSlice() - es.Sort(func(a, b ProfileContainer) bool { - return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) - }) - for i := 1; i < es.Len(); i++ { - assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) - } - es.Sort(func(a, b ProfileContainer) bool { - return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) - }) - for i := 1; i < es.Len(); i++ { - assert.Greater(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) - } -} - -func generateTestProfilesContainersSlice() ProfilesContainersSlice { - es := NewProfilesContainersSlice() - fillTestProfilesContainersSlice(es) - return es -} - -func fillTestProfilesContainersSlice(es ProfilesContainersSlice) { - *es.orig = make([]*otlpprofiles.ProfileContainer, 7) - for i := 0; i < 7; i++ { - (*es.orig)[i] = &otlpprofiles.ProfileContainer{} - fillTestProfileContainer(newProfileContainer((*es.orig)[i], es.state)) - } -} diff --git a/pdata/pprofile/generated_labelslice.go b/pdata/pprofile/generated_profilesslice.go similarity index 61% rename from pdata/pprofile/generated_labelslice.go rename to pdata/pprofile/generated_profilesslice.go index 0296d634da0..69a6309bbb8 100644 --- a/pdata/pprofile/generated_labelslice.go +++ b/pdata/pprofile/generated_profilesslice.go @@ -10,37 +10,37 @@ import ( "sort" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) -// LabelSlice logically represents a slice of Label. +// ProfilesSlice logically represents a slice of Profile. // // This is a reference type. If passed by value and callee modifies it, the // caller will see the modification. // -// Must use NewLabelSlice function to create new instances. +// Must use NewProfilesSlice function to create new instances. // Important: zero-initialized instance is not valid for use. -type LabelSlice struct { - orig *[]*otlpprofiles.Label +type ProfilesSlice struct { + orig *[]*otlpprofiles.Profile state *internal.State } -func newLabelSlice(orig *[]*otlpprofiles.Label, state *internal.State) LabelSlice { - return LabelSlice{orig: orig, state: state} +func newProfilesSlice(orig *[]*otlpprofiles.Profile, state *internal.State) ProfilesSlice { + return ProfilesSlice{orig: orig, state: state} } -// NewLabelSlice creates a LabelSlice with 0 elements. +// NewProfilesSlice creates a ProfilesSlice with 0 elements. // Can use "EnsureCapacity" to initialize with a given capacity. -func NewLabelSlice() LabelSlice { - orig := []*otlpprofiles.Label(nil) +func NewProfilesSlice() ProfilesSlice { + orig := []*otlpprofiles.Profile(nil) state := internal.StateMutable - return newLabelSlice(&orig, &state) + return newProfilesSlice(&orig, &state) } // Len returns the number of elements in the slice. // -// Returns "0" for a newly instance created with "NewLabelSlice()". -func (es LabelSlice) Len() int { +// Returns "0" for a newly instance created with "NewProfilesSlice()". +func (es ProfilesSlice) Len() int { return len(*es.orig) } @@ -52,45 +52,45 @@ func (es LabelSlice) Len() int { // e := es.At(i) // ... // Do something with the element // } -func (es LabelSlice) At(i int) Label { - return newLabel((*es.orig)[i], es.state) +func (es ProfilesSlice) At(i int) Profile { + return newProfile((*es.orig)[i], es.state) } // EnsureCapacity is an operation that ensures the slice has at least the specified capacity. // 1. If the newCap <= cap then no change in capacity. // 2. If the newCap > cap then the slice capacity will be expanded to equal newCap. // -// Here is how a new LabelSlice can be initialized: +// Here is how a new ProfilesSlice can be initialized: // -// es := NewLabelSlice() +// es := NewProfilesSlice() // es.EnsureCapacity(4) // for i := 0; i < 4; i++ { // e := es.AppendEmpty() // // Here should set all the values for e. // } -func (es LabelSlice) EnsureCapacity(newCap int) { +func (es ProfilesSlice) EnsureCapacity(newCap int) { es.state.AssertMutable() oldCap := cap(*es.orig) if newCap <= oldCap { return } - newOrig := make([]*otlpprofiles.Label, len(*es.orig), newCap) + newOrig := make([]*otlpprofiles.Profile, len(*es.orig), newCap) copy(newOrig, *es.orig) *es.orig = newOrig } -// AppendEmpty will append to the end of the slice an empty Label. -// It returns the newly added Label. -func (es LabelSlice) AppendEmpty() Label { +// AppendEmpty will append to the end of the slice an empty Profile. +// It returns the newly added Profile. +func (es ProfilesSlice) AppendEmpty() Profile { es.state.AssertMutable() - *es.orig = append(*es.orig, &otlpprofiles.Label{}) + *es.orig = append(*es.orig, &otlpprofiles.Profile{}) return es.At(es.Len() - 1) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. // The current slice will be cleared. -func (es LabelSlice) MoveAndAppendTo(dest LabelSlice) { +func (es ProfilesSlice) MoveAndAppendTo(dest ProfilesSlice) { es.state.AssertMutable() dest.state.AssertMutable() if *dest.orig == nil { @@ -104,7 +104,7 @@ func (es LabelSlice) MoveAndAppendTo(dest LabelSlice) { // RemoveIf calls f sequentially for each element present in the slice. // If f returns true, the element is removed from the slice. -func (es LabelSlice) RemoveIf(f func(Label) bool) { +func (es ProfilesSlice) RemoveIf(f func(Profile) bool) { es.state.AssertMutable() newLen := 0 for i := 0; i < len(*es.orig); i++ { @@ -123,30 +123,30 @@ func (es LabelSlice) RemoveIf(f func(Label) bool) { } // CopyTo copies all elements from the current slice overriding the destination. -func (es LabelSlice) CopyTo(dest LabelSlice) { +func (es ProfilesSlice) CopyTo(dest ProfilesSlice) { dest.state.AssertMutable() srcLen := es.Len() destCap := cap(*dest.orig) if srcLen <= destCap { (*dest.orig) = (*dest.orig)[:srcLen:destCap] for i := range *es.orig { - newLabel((*es.orig)[i], es.state).CopyTo(newLabel((*dest.orig)[i], dest.state)) + newProfile((*es.orig)[i], es.state).CopyTo(newProfile((*dest.orig)[i], dest.state)) } return } - origs := make([]otlpprofiles.Label, srcLen) - wrappers := make([]*otlpprofiles.Label, srcLen) + origs := make([]otlpprofiles.Profile, srcLen) + wrappers := make([]*otlpprofiles.Profile, srcLen) for i := range *es.orig { wrappers[i] = &origs[i] - newLabel((*es.orig)[i], es.state).CopyTo(newLabel(wrappers[i], dest.state)) + newProfile((*es.orig)[i], es.state).CopyTo(newProfile(wrappers[i], dest.state)) } *dest.orig = wrappers } -// Sort sorts the Label elements within LabelSlice given the -// provided less function so that two instances of LabelSlice +// Sort sorts the Profile elements within ProfilesSlice given the +// provided less function so that two instances of ProfilesSlice // can be compared. -func (es LabelSlice) Sort(less func(a, b Label) bool) { +func (es ProfilesSlice) Sort(less func(a, b Profile) bool) { es.state.AssertMutable() sort.SliceStable(*es.orig, func(i, j int) bool { return less(es.At(i), es.At(j)) }) } diff --git a/pdata/pprofile/generated_labelslice_test.go b/pdata/pprofile/generated_profilesslice_test.go similarity index 57% rename from pdata/pprofile/generated_labelslice_test.go rename to pdata/pprofile/generated_profilesslice_test.go index 4ae3f7a6cbd..b188c6181f3 100644 --- a/pdata/pprofile/generated_labelslice_test.go +++ b/pdata/pprofile/generated_profilesslice_test.go @@ -13,91 +13,91 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) -func TestLabelSlice(t *testing.T) { - es := NewLabelSlice() +func TestProfilesSlice(t *testing.T) { + es := NewProfilesSlice() assert.Equal(t, 0, es.Len()) state := internal.StateMutable - es = newLabelSlice(&[]*otlpprofiles.Label{}, &state) + es = newProfilesSlice(&[]*otlpprofiles.Profile{}, &state) assert.Equal(t, 0, es.Len()) - emptyVal := NewLabel() - testVal := generateTestLabel() + emptyVal := NewProfile() + testVal := generateTestProfile() for i := 0; i < 7; i++ { el := es.AppendEmpty() assert.Equal(t, emptyVal, es.At(i)) - fillTestLabel(el) + fillTestProfile(el) assert.Equal(t, testVal, es.At(i)) } assert.Equal(t, 7, es.Len()) } -func TestLabelSliceReadOnly(t *testing.T) { +func TestProfilesSliceReadOnly(t *testing.T) { sharedState := internal.StateReadOnly - es := newLabelSlice(&[]*otlpprofiles.Label{}, &sharedState) + es := newProfilesSlice(&[]*otlpprofiles.Profile{}, &sharedState) assert.Equal(t, 0, es.Len()) assert.Panics(t, func() { es.AppendEmpty() }) assert.Panics(t, func() { es.EnsureCapacity(2) }) - es2 := NewLabelSlice() + es2 := NewProfilesSlice() es.CopyTo(es2) assert.Panics(t, func() { es2.CopyTo(es) }) assert.Panics(t, func() { es.MoveAndAppendTo(es2) }) assert.Panics(t, func() { es2.MoveAndAppendTo(es) }) } -func TestLabelSlice_CopyTo(t *testing.T) { - dest := NewLabelSlice() +func TestProfilesSlice_CopyTo(t *testing.T) { + dest := NewProfilesSlice() // Test CopyTo to empty - NewLabelSlice().CopyTo(dest) - assert.Equal(t, NewLabelSlice(), dest) + NewProfilesSlice().CopyTo(dest) + assert.Equal(t, NewProfilesSlice(), dest) // Test CopyTo larger slice - generateTestLabelSlice().CopyTo(dest) - assert.Equal(t, generateTestLabelSlice(), dest) + generateTestProfilesSlice().CopyTo(dest) + assert.Equal(t, generateTestProfilesSlice(), dest) // Test CopyTo same size slice - generateTestLabelSlice().CopyTo(dest) - assert.Equal(t, generateTestLabelSlice(), dest) + generateTestProfilesSlice().CopyTo(dest) + assert.Equal(t, generateTestProfilesSlice(), dest) } -func TestLabelSlice_EnsureCapacity(t *testing.T) { - es := generateTestLabelSlice() +func TestProfilesSlice_EnsureCapacity(t *testing.T) { + es := generateTestProfilesSlice() // Test ensure smaller capacity. const ensureSmallLen = 4 es.EnsureCapacity(ensureSmallLen) assert.Less(t, ensureSmallLen, es.Len()) assert.Equal(t, es.Len(), cap(*es.orig)) - assert.Equal(t, generateTestLabelSlice(), es) + assert.Equal(t, generateTestProfilesSlice(), es) // Test ensure larger capacity const ensureLargeLen = 9 es.EnsureCapacity(ensureLargeLen) - assert.Less(t, generateTestLabelSlice().Len(), ensureLargeLen) + assert.Less(t, generateTestProfilesSlice().Len(), ensureLargeLen) assert.Equal(t, ensureLargeLen, cap(*es.orig)) - assert.Equal(t, generateTestLabelSlice(), es) + assert.Equal(t, generateTestProfilesSlice(), es) } -func TestLabelSlice_MoveAndAppendTo(t *testing.T) { +func TestProfilesSlice_MoveAndAppendTo(t *testing.T) { // Test MoveAndAppendTo to empty - expectedSlice := generateTestLabelSlice() - dest := NewLabelSlice() - src := generateTestLabelSlice() + expectedSlice := generateTestProfilesSlice() + dest := NewProfilesSlice() + src := generateTestProfilesSlice() src.MoveAndAppendTo(dest) - assert.Equal(t, generateTestLabelSlice(), dest) + assert.Equal(t, generateTestProfilesSlice(), dest) assert.Equal(t, 0, src.Len()) assert.Equal(t, expectedSlice.Len(), dest.Len()) // Test MoveAndAppendTo empty slice src.MoveAndAppendTo(dest) - assert.Equal(t, generateTestLabelSlice(), dest) + assert.Equal(t, generateTestProfilesSlice(), dest) assert.Equal(t, 0, src.Len()) assert.Equal(t, expectedSlice.Len(), dest.Len()) // Test MoveAndAppendTo not empty slice - generateTestLabelSlice().MoveAndAppendTo(dest) + generateTestProfilesSlice().MoveAndAppendTo(dest) assert.Equal(t, 2*expectedSlice.Len(), dest.Len()) for i := 0; i < expectedSlice.Len(); i++ { assert.Equal(t, expectedSlice.At(i), dest.At(i)) @@ -105,33 +105,33 @@ func TestLabelSlice_MoveAndAppendTo(t *testing.T) { } } -func TestLabelSlice_RemoveIf(t *testing.T) { +func TestProfilesSlice_RemoveIf(t *testing.T) { // Test RemoveIf on empty slice - emptySlice := NewLabelSlice() - emptySlice.RemoveIf(func(el Label) bool { + emptySlice := NewProfilesSlice() + emptySlice.RemoveIf(func(el Profile) bool { t.Fail() return false }) // Test RemoveIf - filtered := generateTestLabelSlice() + filtered := generateTestProfilesSlice() pos := 0 - filtered.RemoveIf(func(el Label) bool { + filtered.RemoveIf(func(el Profile) bool { pos++ return pos%3 == 0 }) assert.Equal(t, 5, filtered.Len()) } -func TestLabelSlice_Sort(t *testing.T) { - es := generateTestLabelSlice() - es.Sort(func(a, b Label) bool { +func TestProfilesSlice_Sort(t *testing.T) { + es := generateTestProfilesSlice() + es.Sort(func(a, b Profile) bool { return uintptr(unsafe.Pointer(a.orig)) < uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { assert.Less(t, uintptr(unsafe.Pointer(es.At(i-1).orig)), uintptr(unsafe.Pointer(es.At(i).orig))) } - es.Sort(func(a, b Label) bool { + es.Sort(func(a, b Profile) bool { return uintptr(unsafe.Pointer(a.orig)) > uintptr(unsafe.Pointer(b.orig)) }) for i := 1; i < es.Len(); i++ { @@ -139,16 +139,16 @@ func TestLabelSlice_Sort(t *testing.T) { } } -func generateTestLabelSlice() LabelSlice { - es := NewLabelSlice() - fillTestLabelSlice(es) +func generateTestProfilesSlice() ProfilesSlice { + es := NewProfilesSlice() + fillTestProfilesSlice(es) return es } -func fillTestLabelSlice(es LabelSlice) { - *es.orig = make([]*otlpprofiles.Label, 7) +func fillTestProfilesSlice(es ProfilesSlice) { + *es.orig = make([]*otlpprofiles.Profile, 7) for i := 0; i < 7; i++ { - (*es.orig)[i] = &otlpprofiles.Label{} - fillTestLabel(newLabel((*es.orig)[i], es.state)) + (*es.orig)[i] = &otlpprofiles.Profile{} + fillTestProfile(newProfile((*es.orig)[i], es.state)) } } diff --git a/pdata/pprofile/generated_resourceprofiles.go b/pdata/pprofile/generated_resourceprofiles.go index 35c0161d7d7..649e5bbf33d 100644 --- a/pdata/pprofile/generated_resourceprofiles.go +++ b/pdata/pprofile/generated_resourceprofiles.go @@ -8,7 +8,7 @@ package pprofile import ( "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" "go.opentelemetry.io/collector/pdata/pcommon" ) diff --git a/pdata/pprofile/generated_resourceprofiles_test.go b/pdata/pprofile/generated_resourceprofiles_test.go index b4da47c3a8c..6afee80ac80 100644 --- a/pdata/pprofile/generated_resourceprofiles_test.go +++ b/pdata/pprofile/generated_resourceprofiles_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" "go.opentelemetry.io/collector/pdata/pcommon" ) diff --git a/pdata/pprofile/generated_resourceprofilesslice.go b/pdata/pprofile/generated_resourceprofilesslice.go index b8ea2a71ba1..c3f7f1053a6 100644 --- a/pdata/pprofile/generated_resourceprofilesslice.go +++ b/pdata/pprofile/generated_resourceprofilesslice.go @@ -10,7 +10,7 @@ import ( "sort" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) // ResourceProfilesSlice logically represents a slice of ResourceProfiles. diff --git a/pdata/pprofile/generated_resourceprofilesslice_test.go b/pdata/pprofile/generated_resourceprofilesslice_test.go index 32ec740a939..834f6fc7303 100644 --- a/pdata/pprofile/generated_resourceprofilesslice_test.go +++ b/pdata/pprofile/generated_resourceprofilesslice_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) func TestResourceProfilesSlice(t *testing.T) { diff --git a/pdata/pprofile/generated_sample.go b/pdata/pprofile/generated_sample.go index 3627b60f7e2..c62027753d2 100644 --- a/pdata/pprofile/generated_sample.go +++ b/pdata/pprofile/generated_sample.go @@ -8,7 +8,7 @@ package pprofile import ( "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -46,68 +46,36 @@ func (ms Sample) MoveTo(dest Sample) { *ms.orig = otlpprofiles.Sample{} } -// LocationIndex returns the LocationIndex associated with this Sample. -func (ms Sample) LocationIndex() pcommon.UInt64Slice { - return pcommon.UInt64Slice(internal.NewUInt64Slice(&ms.orig.LocationIndex, ms.state)) -} - // LocationsStartIndex returns the locationsstartindex associated with this Sample. -func (ms Sample) LocationsStartIndex() uint64 { +func (ms Sample) LocationsStartIndex() int32 { return ms.orig.LocationsStartIndex } // SetLocationsStartIndex replaces the locationsstartindex associated with this Sample. -func (ms Sample) SetLocationsStartIndex(v uint64) { +func (ms Sample) SetLocationsStartIndex(v int32) { ms.state.AssertMutable() ms.orig.LocationsStartIndex = v } // LocationsLength returns the locationslength associated with this Sample. -func (ms Sample) LocationsLength() uint64 { +func (ms Sample) LocationsLength() int32 { return ms.orig.LocationsLength } // SetLocationsLength replaces the locationslength associated with this Sample. -func (ms Sample) SetLocationsLength(v uint64) { +func (ms Sample) SetLocationsLength(v int32) { ms.state.AssertMutable() ms.orig.LocationsLength = v } -// StacktraceIdIndex returns the stacktraceidindex associated with this Sample. -func (ms Sample) StacktraceIdIndex() uint32 { - return ms.orig.StacktraceIdIndex -} - -// SetStacktraceIdIndex replaces the stacktraceidindex associated with this Sample. -func (ms Sample) SetStacktraceIdIndex(v uint32) { - ms.state.AssertMutable() - ms.orig.StacktraceIdIndex = v -} - // Value returns the Value associated with this Sample. func (ms Sample) Value() pcommon.Int64Slice { return pcommon.Int64Slice(internal.NewInt64Slice(&ms.orig.Value, ms.state)) } -// Label returns the Label associated with this Sample. -func (ms Sample) Label() LabelSlice { - return newLabelSlice(&ms.orig.Label, ms.state) -} - -// Attributes returns the Attributes associated with this Sample. -func (ms Sample) Attributes() pcommon.UInt64Slice { - return pcommon.UInt64Slice(internal.NewUInt64Slice(&ms.orig.Attributes, ms.state)) -} - -// Link returns the link associated with this Sample. -func (ms Sample) Link() uint64 { - return ms.orig.Link -} - -// SetLink replaces the link associated with this Sample. -func (ms Sample) SetLink(v uint64) { - ms.state.AssertMutable() - ms.orig.Link = v +// AttributeIndices returns the AttributeIndices associated with this Sample. +func (ms Sample) AttributeIndices() pcommon.Int32Slice { + return pcommon.Int32Slice(internal.NewInt32Slice(&ms.orig.AttributeIndices, ms.state)) } // TimestampsUnixNano returns the TimestampsUnixNano associated with this Sample. @@ -118,13 +86,9 @@ func (ms Sample) TimestampsUnixNano() pcommon.UInt64Slice { // CopyTo copies all properties from the current struct overriding the destination. func (ms Sample) CopyTo(dest Sample) { dest.state.AssertMutable() - ms.LocationIndex().CopyTo(dest.LocationIndex()) dest.SetLocationsStartIndex(ms.LocationsStartIndex()) dest.SetLocationsLength(ms.LocationsLength()) - dest.SetStacktraceIdIndex(ms.StacktraceIdIndex()) ms.Value().CopyTo(dest.Value()) - ms.Label().CopyTo(dest.Label()) - ms.Attributes().CopyTo(dest.Attributes()) - dest.SetLink(ms.Link()) + ms.AttributeIndices().CopyTo(dest.AttributeIndices()) ms.TimestampsUnixNano().CopyTo(dest.TimestampsUnixNano()) } diff --git a/pdata/pprofile/generated_sample_test.go b/pdata/pprofile/generated_sample_test.go index bebc54b18ea..3c535f3c658 100644 --- a/pdata/pprofile/generated_sample_test.go +++ b/pdata/pprofile/generated_sample_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -39,38 +39,22 @@ func TestSample_CopyTo(t *testing.T) { assert.Panics(t, func() { ms.CopyTo(newSample(&otlpprofiles.Sample{}, &sharedState)) }) } -func TestSample_LocationIndex(t *testing.T) { - ms := NewSample() - assert.Equal(t, pcommon.NewUInt64Slice(), ms.LocationIndex()) - internal.FillTestUInt64Slice(internal.UInt64Slice(ms.LocationIndex())) - assert.Equal(t, pcommon.UInt64Slice(internal.GenerateTestUInt64Slice()), ms.LocationIndex()) -} - func TestSample_LocationsStartIndex(t *testing.T) { ms := NewSample() - assert.Equal(t, uint64(0), ms.LocationsStartIndex()) - ms.SetLocationsStartIndex(uint64(1)) - assert.Equal(t, uint64(1), ms.LocationsStartIndex()) + assert.Equal(t, int32(0), ms.LocationsStartIndex()) + ms.SetLocationsStartIndex(int32(1)) + assert.Equal(t, int32(1), ms.LocationsStartIndex()) sharedState := internal.StateReadOnly - assert.Panics(t, func() { newSample(&otlpprofiles.Sample{}, &sharedState).SetLocationsStartIndex(uint64(1)) }) + assert.Panics(t, func() { newSample(&otlpprofiles.Sample{}, &sharedState).SetLocationsStartIndex(int32(1)) }) } func TestSample_LocationsLength(t *testing.T) { ms := NewSample() - assert.Equal(t, uint64(0), ms.LocationsLength()) - ms.SetLocationsLength(uint64(1)) - assert.Equal(t, uint64(1), ms.LocationsLength()) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { newSample(&otlpprofiles.Sample{}, &sharedState).SetLocationsLength(uint64(1)) }) -} - -func TestSample_StacktraceIdIndex(t *testing.T) { - ms := NewSample() - assert.Equal(t, uint32(0), ms.StacktraceIdIndex()) - ms.SetStacktraceIdIndex(uint32(1)) - assert.Equal(t, uint32(1), ms.StacktraceIdIndex()) + assert.Equal(t, int32(0), ms.LocationsLength()) + ms.SetLocationsLength(int32(1)) + assert.Equal(t, int32(1), ms.LocationsLength()) sharedState := internal.StateReadOnly - assert.Panics(t, func() { newSample(&otlpprofiles.Sample{}, &sharedState).SetStacktraceIdIndex(uint32(1)) }) + assert.Panics(t, func() { newSample(&otlpprofiles.Sample{}, &sharedState).SetLocationsLength(int32(1)) }) } func TestSample_Value(t *testing.T) { @@ -80,27 +64,11 @@ func TestSample_Value(t *testing.T) { assert.Equal(t, pcommon.Int64Slice(internal.GenerateTestInt64Slice()), ms.Value()) } -func TestSample_Label(t *testing.T) { +func TestSample_AttributeIndices(t *testing.T) { ms := NewSample() - assert.Equal(t, NewLabelSlice(), ms.Label()) - fillTestLabelSlice(ms.Label()) - assert.Equal(t, generateTestLabelSlice(), ms.Label()) -} - -func TestSample_Attributes(t *testing.T) { - ms := NewSample() - assert.Equal(t, pcommon.NewUInt64Slice(), ms.Attributes()) - internal.FillTestUInt64Slice(internal.UInt64Slice(ms.Attributes())) - assert.Equal(t, pcommon.UInt64Slice(internal.GenerateTestUInt64Slice()), ms.Attributes()) -} - -func TestSample_Link(t *testing.T) { - ms := NewSample() - assert.Equal(t, uint64(0), ms.Link()) - ms.SetLink(uint64(1)) - assert.Equal(t, uint64(1), ms.Link()) - sharedState := internal.StateReadOnly - assert.Panics(t, func() { newSample(&otlpprofiles.Sample{}, &sharedState).SetLink(uint64(1)) }) + assert.Equal(t, pcommon.NewInt32Slice(), ms.AttributeIndices()) + internal.FillTestInt32Slice(internal.Int32Slice(ms.AttributeIndices())) + assert.Equal(t, pcommon.Int32Slice(internal.GenerateTestInt32Slice()), ms.AttributeIndices()) } func TestSample_TimestampsUnixNano(t *testing.T) { @@ -117,13 +85,9 @@ func generateTestSample() Sample { } func fillTestSample(tv Sample) { - internal.FillTestUInt64Slice(internal.NewUInt64Slice(&tv.orig.LocationIndex, tv.state)) - tv.orig.LocationsStartIndex = uint64(1) - tv.orig.LocationsLength = uint64(1) - tv.orig.StacktraceIdIndex = uint32(1) + tv.orig.LocationsStartIndex = int32(1) + tv.orig.LocationsLength = int32(1) internal.FillTestInt64Slice(internal.NewInt64Slice(&tv.orig.Value, tv.state)) - fillTestLabelSlice(newLabelSlice(&tv.orig.Label, tv.state)) - internal.FillTestUInt64Slice(internal.NewUInt64Slice(&tv.orig.Attributes, tv.state)) - tv.orig.Link = uint64(1) + internal.FillTestInt32Slice(internal.NewInt32Slice(&tv.orig.AttributeIndices, tv.state)) internal.FillTestUInt64Slice(internal.NewUInt64Slice(&tv.orig.TimestampsUnixNano, tv.state)) } diff --git a/pdata/pprofile/generated_sampleslice.go b/pdata/pprofile/generated_sampleslice.go index 64065c10757..cf624434824 100644 --- a/pdata/pprofile/generated_sampleslice.go +++ b/pdata/pprofile/generated_sampleslice.go @@ -10,7 +10,7 @@ import ( "sort" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) // SampleSlice logically represents a slice of Sample. diff --git a/pdata/pprofile/generated_sampleslice_test.go b/pdata/pprofile/generated_sampleslice_test.go index 9c758e0dc02..16ab136a059 100644 --- a/pdata/pprofile/generated_sampleslice_test.go +++ b/pdata/pprofile/generated_sampleslice_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) func TestSampleSlice(t *testing.T) { diff --git a/pdata/pprofile/generated_scopeprofiles.go b/pdata/pprofile/generated_scopeprofiles.go index e213b2660ba..920b578a5be 100644 --- a/pdata/pprofile/generated_scopeprofiles.go +++ b/pdata/pprofile/generated_scopeprofiles.go @@ -8,7 +8,7 @@ package pprofile import ( "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -63,8 +63,8 @@ func (ms ScopeProfiles) SetSchemaUrl(v string) { } // Profiles returns the Profiles associated with this ScopeProfiles. -func (ms ScopeProfiles) Profiles() ProfilesContainersSlice { - return newProfilesContainersSlice(&ms.orig.Profiles, ms.state) +func (ms ScopeProfiles) Profiles() ProfilesSlice { + return newProfilesSlice(&ms.orig.Profiles, ms.state) } // CopyTo copies all properties from the current struct overriding the destination. diff --git a/pdata/pprofile/generated_scopeprofiles_test.go b/pdata/pprofile/generated_scopeprofiles_test.go index 42fa23907f6..e46473b8b8b 100644 --- a/pdata/pprofile/generated_scopeprofiles_test.go +++ b/pdata/pprofile/generated_scopeprofiles_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -58,9 +58,9 @@ func TestScopeProfiles_SchemaUrl(t *testing.T) { func TestScopeProfiles_Profiles(t *testing.T) { ms := NewScopeProfiles() - assert.Equal(t, NewProfilesContainersSlice(), ms.Profiles()) - fillTestProfilesContainersSlice(ms.Profiles()) - assert.Equal(t, generateTestProfilesContainersSlice(), ms.Profiles()) + assert.Equal(t, NewProfilesSlice(), ms.Profiles()) + fillTestProfilesSlice(ms.Profiles()) + assert.Equal(t, generateTestProfilesSlice(), ms.Profiles()) } func generateTestScopeProfiles() ScopeProfiles { @@ -72,5 +72,5 @@ func generateTestScopeProfiles() ScopeProfiles { func fillTestScopeProfiles(tv ScopeProfiles) { internal.FillTestInstrumentationScope(internal.NewInstrumentationScope(&tv.orig.Scope, tv.state)) tv.orig.SchemaUrl = "https://opentelemetry.io/schemas/1.5.0" - fillTestProfilesContainersSlice(newProfilesContainersSlice(&tv.orig.Profiles, tv.state)) + fillTestProfilesSlice(newProfilesSlice(&tv.orig.Profiles, tv.state)) } diff --git a/pdata/pprofile/generated_scopeprofilesslice.go b/pdata/pprofile/generated_scopeprofilesslice.go index 766ee38310b..3f2b452cece 100644 --- a/pdata/pprofile/generated_scopeprofilesslice.go +++ b/pdata/pprofile/generated_scopeprofilesslice.go @@ -10,7 +10,7 @@ import ( "sort" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) // ScopeProfilesSlice logically represents a slice of ScopeProfiles. diff --git a/pdata/pprofile/generated_scopeprofilesslice_test.go b/pdata/pprofile/generated_scopeprofilesslice_test.go index 78dc1f05f1a..d78ef7446f5 100644 --- a/pdata/pprofile/generated_scopeprofilesslice_test.go +++ b/pdata/pprofile/generated_scopeprofilesslice_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) func TestScopeProfilesSlice(t *testing.T) { diff --git a/pdata/pprofile/generated_valuetype.go b/pdata/pprofile/generated_valuetype.go index 32280993a2d..2afc8614048 100644 --- a/pdata/pprofile/generated_valuetype.go +++ b/pdata/pprofile/generated_valuetype.go @@ -8,7 +8,7 @@ package pprofile import ( "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) // ValueType describes the type and units of a value, with an optional aggregation temporality. @@ -45,26 +45,26 @@ func (ms ValueType) MoveTo(dest ValueType) { *ms.orig = otlpprofiles.ValueType{} } -// Type returns the type associated with this ValueType. -func (ms ValueType) Type() int64 { - return ms.orig.Type +// TypeStrindex returns the typestrindex associated with this ValueType. +func (ms ValueType) TypeStrindex() int32 { + return ms.orig.TypeStrindex } -// SetType replaces the type associated with this ValueType. -func (ms ValueType) SetType(v int64) { +// SetTypeStrindex replaces the typestrindex associated with this ValueType. +func (ms ValueType) SetTypeStrindex(v int32) { ms.state.AssertMutable() - ms.orig.Type = v + ms.orig.TypeStrindex = v } -// Unit returns the unit associated with this ValueType. -func (ms ValueType) Unit() int64 { - return ms.orig.Unit +// UnitStrindex returns the unitstrindex associated with this ValueType. +func (ms ValueType) UnitStrindex() int32 { + return ms.orig.UnitStrindex } -// SetUnit replaces the unit associated with this ValueType. -func (ms ValueType) SetUnit(v int64) { +// SetUnitStrindex replaces the unitstrindex associated with this ValueType. +func (ms ValueType) SetUnitStrindex(v int32) { ms.state.AssertMutable() - ms.orig.Unit = v + ms.orig.UnitStrindex = v } // AggregationTemporality returns the aggregationtemporality associated with this ValueType. @@ -81,7 +81,7 @@ func (ms ValueType) SetAggregationTemporality(v otlpprofiles.AggregationTemporal // CopyTo copies all properties from the current struct overriding the destination. func (ms ValueType) CopyTo(dest ValueType) { dest.state.AssertMutable() - dest.SetType(ms.Type()) - dest.SetUnit(ms.Unit()) + dest.SetTypeStrindex(ms.TypeStrindex()) + dest.SetUnitStrindex(ms.UnitStrindex()) dest.SetAggregationTemporality(ms.AggregationTemporality()) } diff --git a/pdata/pprofile/generated_valuetype_test.go b/pdata/pprofile/generated_valuetype_test.go index d2b557f2294..8e535a15086 100644 --- a/pdata/pprofile/generated_valuetype_test.go +++ b/pdata/pprofile/generated_valuetype_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) func TestValueType_MoveTo(t *testing.T) { @@ -38,22 +38,22 @@ func TestValueType_CopyTo(t *testing.T) { assert.Panics(t, func() { ms.CopyTo(newValueType(&otlpprofiles.ValueType{}, &sharedState)) }) } -func TestValueType_Type(t *testing.T) { +func TestValueType_TypeStrindex(t *testing.T) { ms := NewValueType() - assert.Equal(t, int64(0), ms.Type()) - ms.SetType(int64(1)) - assert.Equal(t, int64(1), ms.Type()) + assert.Equal(t, int32(0), ms.TypeStrindex()) + ms.SetTypeStrindex(int32(1)) + assert.Equal(t, int32(1), ms.TypeStrindex()) sharedState := internal.StateReadOnly - assert.Panics(t, func() { newValueType(&otlpprofiles.ValueType{}, &sharedState).SetType(int64(1)) }) + assert.Panics(t, func() { newValueType(&otlpprofiles.ValueType{}, &sharedState).SetTypeStrindex(int32(1)) }) } -func TestValueType_Unit(t *testing.T) { +func TestValueType_UnitStrindex(t *testing.T) { ms := NewValueType() - assert.Equal(t, int64(0), ms.Unit()) - ms.SetUnit(int64(1)) - assert.Equal(t, int64(1), ms.Unit()) + assert.Equal(t, int32(0), ms.UnitStrindex()) + ms.SetUnitStrindex(int32(1)) + assert.Equal(t, int32(1), ms.UnitStrindex()) sharedState := internal.StateReadOnly - assert.Panics(t, func() { newValueType(&otlpprofiles.ValueType{}, &sharedState).SetUnit(int64(1)) }) + assert.Panics(t, func() { newValueType(&otlpprofiles.ValueType{}, &sharedState).SetUnitStrindex(int32(1)) }) } func TestValueType_AggregationTemporality(t *testing.T) { @@ -74,7 +74,7 @@ func generateTestValueType() ValueType { } func fillTestValueType(tv ValueType) { - tv.orig.Type = int64(1) - tv.orig.Unit = int64(1) + tv.orig.TypeStrindex = int32(1) + tv.orig.UnitStrindex = int32(1) tv.orig.AggregationTemporality = otlpprofiles.AggregationTemporality(1) } diff --git a/pdata/pprofile/generated_valuetypeslice.go b/pdata/pprofile/generated_valuetypeslice.go index dcbe574a3cc..65d5f78bd7d 100644 --- a/pdata/pprofile/generated_valuetypeslice.go +++ b/pdata/pprofile/generated_valuetypeslice.go @@ -10,7 +10,7 @@ import ( "sort" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) // ValueTypeSlice logically represents a slice of ValueType. diff --git a/pdata/pprofile/generated_valuetypeslice_test.go b/pdata/pprofile/generated_valuetypeslice_test.go index 79b380a8897..f41809cc74a 100644 --- a/pdata/pprofile/generated_valuetypeslice_test.go +++ b/pdata/pprofile/generated_valuetypeslice_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) func TestValueTypeSlice(t *testing.T) { diff --git a/pdata/pprofile/json.go b/pdata/pprofile/json.go index 0cb8e88a456..cac811d4f30 100644 --- a/pdata/pprofile/json.go +++ b/pdata/pprofile/json.go @@ -10,7 +10,7 @@ import ( jsoniter "github.com/json-iterator/go" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/internal/otlp" ) @@ -95,40 +95,13 @@ func (sp ScopeProfiles) unmarshalJsoniter(iter *jsoniter.Iterator) { }) } -func (pc ProfileContainer) unmarshalJsoniter(iter *jsoniter.Iterator) { +func (p Profile) unmarshalJsoniter(iter *jsoniter.Iterator) { iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { switch f { case "profileId", "profile_id": - if err := pc.orig.ProfileId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { + if err := p.orig.ProfileId.UnmarshalJSON([]byte(iter.ReadString())); err != nil { iter.ReportError("profileContainer.profileId", fmt.Sprintf("parse profile_id:%v", err)) } - case "startTimeUnixNano", "start_time_unix_nano": - pc.orig.StartTimeUnixNano = json.ReadUint64(iter) - case "endTimeUnixNano", "end_time_unix_nano": - pc.orig.EndTimeUnixNano = json.ReadUint64(iter) - case "attributes": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - pc.orig.Attributes = append(pc.orig.Attributes, json.ReadAttribute(iter)) - return true - }) - case "droppedAttributesCount", "dropped_attributes_count": - pc.orig.DroppedAttributesCount = json.ReadUint32(iter) - case "originalPayloadFormat", "original_payload_format": - pc.orig.OriginalPayloadFormat = iter.ReadString() - case "originalPayload", "original_payload": - pc.orig.OriginalPayload = iter.ReadStringAsSlice() - case "profile": - pc.Profile().unmarshalJsoniter(iter) - default: - iter.Skip() - } - return true - }) -} - -func (p Profile) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { case "sampleType", "sample_type": iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { p.SampleType().AppendEmpty().unmarshalJsoniter(iter) @@ -139,24 +112,24 @@ func (p Profile) unmarshalJsoniter(iter *jsoniter.Iterator) { p.Sample().AppendEmpty().unmarshalJsoniter(iter) return true }) - case "mapping": + case "mappingTable", "mapping_table": iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - p.Mapping().AppendEmpty().unmarshalJsoniter(iter) + p.MappingTable().AppendEmpty().unmarshalJsoniter(iter) return true }) - case "location": + case "locationTable", "location_table": iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - p.Location().AppendEmpty().unmarshalJsoniter(iter) + p.LocationTable().AppendEmpty().unmarshalJsoniter(iter) return true }) case "locationIndices", "location_indices": iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - p.LocationIndices().Append(json.ReadInt64(iter)) + p.LocationIndices().Append(json.ReadInt32(iter)) return true }) - case "function": + case "functionTable", "function_table": iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - p.Function().AppendEmpty().unmarshalJsoniter(iter) + p.FunctionTable().AppendEmpty().unmarshalJsoniter(iter) return true }) case "attributeTable", "attribute_table": @@ -179,10 +152,6 @@ func (p Profile) unmarshalJsoniter(iter *jsoniter.Iterator) { p.StringTable().Append(iter.ReadString()) return true }) - case "dropFrames", "drop_frames": - p.orig.DropFrames = json.ReadInt64(iter) - case "keepFrames", "keep_frames": - p.orig.KeepFrames = json.ReadInt64(iter) case "timeNanos", "time_nanos": p.orig.TimeNanos = json.ReadInt64(iter) case "durationNanos", "duration_nanos": @@ -191,13 +160,24 @@ func (p Profile) unmarshalJsoniter(iter *jsoniter.Iterator) { p.PeriodType().unmarshalJsoniter(iter) case "period": p.orig.Period = json.ReadInt64(iter) - case "comment": + case "commentStrindices", "comment_strindices": + iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { + p.CommentStrindices().Append(json.ReadInt32(iter)) + return true + }) + case "defaultSampleTypeStrindex", "default_sample_type_strindex": + p.orig.DefaultSampleTypeStrindex = json.ReadInt32(iter) + case "attributes": iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - p.Comment().Append(json.ReadInt64(iter)) + p.orig.Attributes = append(p.orig.Attributes, json.ReadAttribute(iter)) return true }) - case "defaultSampleType", "default_sample_type": - p.orig.DefaultSampleType = json.ReadInt64(iter) + case "droppedAttributesCount", "dropped_attributes_count": + p.orig.DroppedAttributesCount = json.ReadUint32(iter) + case "originalPayloadFormat", "original_payload_format": + p.orig.OriginalPayloadFormat = iter.ReadString() + case "originalPayload", "original_payload": + p.orig.OriginalPayload = iter.ReadStringAsSlice() default: iter.Skip() } @@ -208,10 +188,12 @@ func (p Profile) unmarshalJsoniter(iter *jsoniter.Iterator) { func (vt ValueType) unmarshalJsoniter(iter *jsoniter.Iterator) { iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { switch f { - case "type": - vt.orig.Type = json.ReadInt64(iter) - case "unit": - vt.orig.Unit = json.ReadInt64(iter) + case "typeStrindex", "type_strindex": + vt.orig.TypeStrindex = json.ReadInt32(iter) + case "unitStrindex", "unit_strindex": + vt.orig.UnitStrindex = json.ReadInt32(iter) + case "aggregationTemporality", "aggregation_temporality": + vt.orig.AggregationTemporality = otlpprofiles.AggregationTemporality(json.ReadInt32(iter)) default: iter.Skip() } @@ -222,34 +204,22 @@ func (vt ValueType) unmarshalJsoniter(iter *jsoniter.Iterator) { func (st Sample) unmarshalJsoniter(iter *jsoniter.Iterator) { iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { switch f { - case "locationIndex", "location_index": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - st.LocationIndex().Append(json.ReadUint64(iter)) - return true - }) case "locationsStartIndex", "locations_start_index": - st.orig.LocationsStartIndex = json.ReadUint64(iter) + st.orig.LocationsStartIndex = json.ReadInt32(iter) case "locationsLength", "locations_length": - st.orig.LocationsLength = json.ReadUint64(iter) - case "stacktraceIdIndex", "stacktrace_id_index": - st.orig.StacktraceIdIndex = json.ReadUint32(iter) + st.orig.LocationsLength = json.ReadInt32(iter) case "value": iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { st.Value().Append(json.ReadInt64(iter)) return true }) - case "label": + case "attributeIndices", "attribute_indices": iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - st.Label().AppendEmpty().unmarshalJsoniter(iter) + st.AttributeIndices().Append(json.ReadInt32(iter)) return true }) - case "attributes": - iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - st.Attributes().Append(json.ReadUint64(iter)) - return true - }) - case "link": - st.orig.Link = json.ReadUint64(iter) + case "linkIndex", "link_index": + st.orig.LinkIndex_ = &otlpprofiles.Sample_LinkIndex{LinkIndex: json.ReadInt32(iter)} case "timestampsUnixNano", "timestamps_unix_nano": iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { st.TimestampsUnixNano().Append(json.ReadUint64(iter)) @@ -265,23 +235,17 @@ func (st Sample) unmarshalJsoniter(iter *jsoniter.Iterator) { func (m Mapping) unmarshalJsoniter(iter *jsoniter.Iterator) { iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { switch f { - case "id": - m.orig.Id = json.ReadUint64(iter) case "memoryStart", "memory_start": m.orig.MemoryStart = json.ReadUint64(iter) case "memoryLimit", "memory_limit": m.orig.MemoryLimit = json.ReadUint64(iter) case "fileOffset", "file_offset": m.orig.FileOffset = json.ReadUint64(iter) - case "filename": - m.orig.Filename = json.ReadInt64(iter) - case "buildId", "build_id": - m.orig.BuildId = json.ReadInt64(iter) - case "buildIDKind", "build_id_kind": - m.SetBuildIDKind(otlpprofiles.BuildIdKind(json.ReadEnumValue(iter, otlpprofiles.BuildIdKind_value))) - case "attributes": + case "filenameStrindex", "filename_strindex": + m.orig.FilenameStrindex = json.ReadInt32(iter) + case "attributeIndices", "attribute_indices": iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - m.Attributes().Append(json.ReadUint64(iter)) + m.AttributeIndices().Append(json.ReadInt32(iter)) return true }) case "hasFunctions", "has_functions": @@ -302,10 +266,8 @@ func (m Mapping) unmarshalJsoniter(iter *jsoniter.Iterator) { func (l Location) unmarshalJsoniter(iter *jsoniter.Iterator) { iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { switch f { - case "id": - l.orig.Id = json.ReadUint64(iter) case "mappingIndex", "mapping_index": - l.orig.MappingIndex = json.ReadUint64(iter) + l.orig.MappingIndex_ = &otlpprofiles.Location_MappingIndex{MappingIndex: json.ReadInt32(iter)} case "address": l.orig.Address = json.ReadUint64(iter) case "line": @@ -315,11 +277,9 @@ func (l Location) unmarshalJsoniter(iter *jsoniter.Iterator) { }) case "isFolded", "is_folded": l.orig.IsFolded = iter.ReadBool() - case "typeIndex", "type_index": - l.orig.TypeIndex = json.ReadUint32(iter) - case "attributes": + case "attributeIndices", "attribute_indices": iter.ReadArrayCB(func(iter *jsoniter.Iterator) bool { - l.Attributes().Append(json.ReadUint64(iter)) + l.AttributeIndices().Append(json.ReadInt32(iter)) return true }) default: @@ -333,7 +293,7 @@ func (l Line) unmarshalJsoniter(iter *jsoniter.Iterator) { iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { switch f { case "functionIndex", "function_index": - l.orig.FunctionIndex = json.ReadUint64(iter) + l.orig.FunctionIndex = json.ReadInt32(iter) case "line": l.orig.Line = json.ReadInt64(iter) case "column": @@ -348,14 +308,12 @@ func (l Line) unmarshalJsoniter(iter *jsoniter.Iterator) { func (fn Function) unmarshalJsoniter(iter *jsoniter.Iterator) { iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { switch f { - case "id": - fn.orig.Id = json.ReadUint64(iter) - case "name": - fn.orig.Name = json.ReadInt64(iter) - case "systemName", "system_name": - fn.orig.SystemName = json.ReadInt64(iter) - case "filename": - fn.orig.Filename = json.ReadInt64(iter) + case "nameStrindex", "name_strindex": + fn.orig.NameStrindex = json.ReadInt32(iter) + case "systemNameStrindex", "system_name_strindex": + fn.orig.SystemNameStrindex = json.ReadInt32(iter) + case "filenameStrindex", "filename_strindex": + fn.orig.FilenameStrindex = json.ReadInt32(iter) case "startLine", "start_line": fn.orig.StartLine = json.ReadInt64(iter) default: @@ -368,10 +326,10 @@ func (fn Function) unmarshalJsoniter(iter *jsoniter.Iterator) { func (at AttributeUnit) unmarshalJsoniter(iter *jsoniter.Iterator) { iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { switch f { - case "attributeKey", "attribute_key": - at.orig.AttributeKey = json.ReadInt64(iter) - case "unit": - at.orig.Unit = json.ReadInt64(iter) + case "attributeKeyStrindex", "attribute_key_strindex": + at.orig.AttributeKeyStrindex = json.ReadInt32(iter) + case "unitStrindex", "unit_strindex": + at.orig.UnitStrindex = json.ReadInt32(iter) default: iter.Skip() } @@ -396,21 +354,3 @@ func (l Link) unmarshalJsoniter(iter *jsoniter.Iterator) { return true }) } - -func (l Label) unmarshalJsoniter(iter *jsoniter.Iterator) { - iter.ReadObjectCB(func(iter *jsoniter.Iterator, f string) bool { - switch f { - case "key": - l.orig.Key = json.ReadInt64(iter) - case "str": - l.orig.Str = json.ReadInt64(iter) - case "num": - l.orig.Num = json.ReadInt64(iter) - case "numUnit", "num_unit": - l.orig.NumUnit = json.ReadInt64(iter) - default: - iter.Skip() - } - return true - }) -} diff --git a/pdata/pprofile/json_test.go b/pdata/pprofile/json_test.go index 98bdd858e64..1fa8480a53c 100644 --- a/pdata/pprofile/json_test.go +++ b/pdata/pprofile/json_test.go @@ -10,7 +10,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -19,7 +18,7 @@ var _ Unmarshaler = (*JSONUnmarshaler)(nil) var profilesOTLP = func() Profiles { startTimestamp := pcommon.Timestamp(1684617382541971000) - endTimestamp := pcommon.Timestamp(1684623646539558000) + durationTimestamp := pcommon.Timestamp(1684623646539558000) profileID := ProfileID([16]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10}) traceID := pcommon.TraceID([16]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10}) spanID := pcommon.SpanID([8]byte{0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18}) @@ -38,98 +37,90 @@ var profilesOTLP = func() Profiles { sp.Scope().SetName("scope name") sp.Scope().SetVersion("scope version") // Add profiles - pc := sp.Profiles().AppendEmpty() - pc.SetProfileID(profileID) - pc.SetStartTime(startTimestamp) - pc.SetEndTime(endTimestamp) - pc.Attributes().PutStr("hello", "world") - pc.Attributes().PutStr("foo", "bar") - pc.SetDroppedAttributesCount(1) - - pro := pc.Profile() + pro := sp.Profiles().AppendEmpty() + pro.SetProfileID(profileID) + pro.SetTime(startTimestamp) + pro.SetDuration(durationTimestamp) + pro.Attributes().PutStr("hello", "world") + pro.Attributes().PutStr("foo", "bar") + pro.SetDroppedAttributesCount(1) + // Add sample type st := pro.SampleType().AppendEmpty() - st.SetType(1) - st.SetUnit(2) + st.SetTypeStrindex(1) + st.SetUnitStrindex(2) // Add samples s := pro.Sample().AppendEmpty() - s.LocationIndex().Append(1) s.SetLocationsStartIndex(1) s.SetLocationsLength(10) - s.SetStacktraceIdIndex(1) s.Value().Append(3) - s.SetLink(42) - s.Attributes().Append(1) - la := s.Label().AppendEmpty() - la.SetKey(1) - la.SetStr(2) - la.SetNum(3) - la.SetNumUnit(4) + s.AttributeIndices().Append(1) s.TimestampsUnixNano().Append(12345) + // Add mappings - m := pro.Mapping().AppendEmpty() - m.SetID(1) + m := pro.MappingTable().AppendEmpty() m.SetMemoryStart(2) m.SetMemoryLimit(3) m.SetFileOffset(4) - m.SetFilename(5) - m.SetBuildID(6) - m.SetBuildIDKind(otlpprofiles.BuildIdKind_BUILD_ID_LINKER) - m.Attributes().Append(7) - m.Attributes().Append(8) + m.SetFilenameStrindex(5) + m.AttributeIndices().Append(7) + m.AttributeIndices().Append(8) m.SetHasFunctions(true) m.SetHasFilenames(true) m.SetHasLineNumbers(true) m.SetHasInlineFrames(true) + // Add location - l := pro.Location().AppendEmpty() - l.SetID(2) + l := pro.LocationTable().AppendEmpty() l.SetMappingIndex(3) l.SetAddress(4) l.SetIsFolded(true) - l.SetTypeIndex(5) - l.Attributes().Append(6) - l.Attributes().Append(7) + l.AttributeIndices().Append(6) + l.AttributeIndices().Append(7) li := l.Line().AppendEmpty() li.SetFunctionIndex(1) li.SetLine(2) li.SetColumn(3) pro.LocationIndices().Append(1) + // Add function - f := pro.Function().AppendEmpty() - f.SetID(1) - f.SetName(2) - f.SetSystemName(3) - f.SetFilename(4) + f := pro.FunctionTable().AppendEmpty() + f.SetNameStrindex(2) + f.SetSystemNameStrindex(3) + f.SetFilenameStrindex(4) f.SetStartLine(5) + // Add attribute table at := pro.AttributeTable() - at.PutInt("answer", 42) + a := at.AppendEmpty() + a.SetKey("answer") + a.Value().SetInt(42) + // Add attribute units au := pro.AttributeUnits().AppendEmpty() - au.SetAttributeKey(1) - au.SetUnit(5) + au.SetAttributeKeyStrindex(1) + au.SetUnitStrindex(5) + // Add link table lt := pro.LinkTable().AppendEmpty() lt.SetTraceID(traceID) lt.SetSpanID(spanID) + // Add string table pro.StringTable().Append("foobar") - pro.SetDropFrames(1) - pro.SetKeepFrames(2) - pro.SetStartTime(1234) + pro.SetTime(1234) pro.SetDuration(5678) - pro.PeriodType().SetType(1) - pro.PeriodType().SetUnit(2) + pro.PeriodType().SetTypeStrindex(1) + pro.PeriodType().SetUnitStrindex(2) pro.SetPeriod(3) - pro.Comment().Append(1) - pro.Comment().Append(2) - pro.SetDefaultSampleType(4) + pro.CommentStrindices().Append(1) + pro.CommentStrindices().Append(2) + pro.SetDefaultSampleTypeStrindex(4) return pd }() -var profilesJSON = `{"resourceProfiles":[{"resource":{"attributes":[{"key":"host.name","value":{"stringValue":"testHost"}},{"key":"service.name","value":{"stringValue":"testService"}}],"droppedAttributesCount":1},"scopeProfiles":[{"scope":{"name":"scope name","version":"scope version"},"profiles":[{"profileId":"0102030405060708090a0b0c0d0e0f10","startTimeUnixNano":"1684617382541971000","endTimeUnixNano":"1684623646539558000","attributes":[{"key":"hello","value":{"stringValue":"world"}},{"key":"foo","value":{"stringValue":"bar"}}],"droppedAttributesCount":1,"profile":{"sampleType":[{"type":"1","unit":"2"}],"sample":[{"locationIndex":["1"],"locationsStartIndex":"1","locationsLength":"10","stacktraceIdIndex":1,"value":["3"],"label":[{"key":"1","str":"2","num":"3","numUnit":"4"}],"attributes":["1"],"link":"42","timestampsUnixNano":["12345"]}],"mapping":[{"id":"1","memoryStart":"2","memoryLimit":"3","fileOffset":"4","filename":"5","buildId":"6","attributes":["7","8"],"hasFunctions":true,"hasFilenames":true,"hasLineNumbers":true,"hasInlineFrames":true}],"location":[{"id":"2","mappingIndex":"3","address":"4","line":[{"functionIndex":"1","line":"2","column":"3"}],"isFolded":true,"typeIndex":5,"attributes":["6","7"]}],"locationIndices":["1"],"function":[{"id":"1","name":"2","systemName":"3","filename":"4","startLine":"5"}],"attributeTable":[{"key":"answer","value":{"intValue":"42"}}],"attributeUnits":[{"attributeKey":"1","unit":"5"}],"linkTable":[{"traceId":"0102030405060708090a0b0c0d0e0f10","spanId":"1112131415161718"}],"stringTable":["foobar"],"dropFrames":"1","keepFrames":"2","timeNanos":"1234","durationNanos":"5678","periodType":{"type":"1","unit":"2"},"period":"3","comment":["1","2"],"defaultSampleType":"4"}}],"schemaUrl":"schemaURL"}],"schemaUrl":"schemaURL"}]}` +var profilesJSON = `{"resourceProfiles":[{"resource":{"attributes":[{"key":"host.name","value":{"stringValue":"testHost"}},{"key":"service.name","value":{"stringValue":"testService"}}],"droppedAttributesCount":1},"scopeProfiles":[{"scope":{"name":"scope name","version":"scope version"},"profiles":[{"sampleType":[{"typeStrindex":1,"unitStrindex":2}],"sample":[{"locationsStartIndex":1,"locationsLength":10,"value":["3"],"attributeIndices":[1],"timestampsUnixNano":["12345"]}],"mappingTable":[{"memoryStart":"2","memoryLimit":"3","fileOffset":"4","filenameStrindex":5,"attributeIndices":[7,8],"hasFunctions":true,"hasFilenames":true,"hasLineNumbers":true,"hasInlineFrames":true}],"locationTable":[{"mappingIndex":3,"address":"4","line":[{"functionIndex":1,"line":"2","column":"3"}],"isFolded":true,"attributeIndices":[6,7]}],"locationIndices":[1],"functionTable":[{"nameStrindex":2,"systemNameStrindex":3,"filenameStrindex":4,"startLine":"5"}],"attributeTable":[{"key":"answer","value":{"intValue":"42"}}],"attributeUnits":[{"attributeKeyStrindex":1,"unitStrindex":5}],"linkTable":[{"traceId":"0102030405060708090a0b0c0d0e0f10","spanId":"1112131415161718"}],"stringTable":["foobar"],"timeNanos":"1234","durationNanos":"5678","periodType":{"typeStrindex":1,"unitStrindex":2},"period":"3","commentStrindices":[1,2],"defaultSampleTypeStrindex":4,"profileId":"0102030405060708090a0b0c0d0e0f10","attributes":[{"key":"hello","value":{"stringValue":"world"}},{"key":"foo","value":{"stringValue":"bar"}}],"droppedAttributesCount":1}],"schemaUrl":"schemaURL"}],"schemaUrl":"schemaURL"}]}` func TestJSONUnmarshal(t *testing.T) { decoder := &JSONUnmarshaler{} @@ -166,7 +157,7 @@ func TestUnmarshalJsoniterProfileInvalidProfileIDField(t *testing.T) { jsonStr := `{"profile_id":"--"}` iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) defer jsoniter.ConfigFastest.ReturnIterator(iter) - NewProfileContainer().unmarshalJsoniter(iter) + NewProfile().unmarshalJsoniter(iter) assert.ErrorContains(t, iter.Error, "parse profile_id") } @@ -296,16 +287,6 @@ func TestUnmarshalJsoniterSpanLinkInvalidSpanIDField(t *testing.T) { assert.ErrorContains(t, iter.Error, "parse span_id") } -func TestUnmarshalJsoniterLabel(t *testing.T) { - jsonStr := `{"extra":""}` - iter := jsoniter.ConfigFastest.BorrowIterator([]byte(jsonStr)) - defer jsoniter.ConfigFastest.ReturnIterator(iter) - val := NewLabel() - val.unmarshalJsoniter(iter) - require.NoError(t, iter.Error) - assert.Equal(t, NewLabel(), val) -} - func BenchmarkJSONUnmarshal(b *testing.B) { b.ReportAllocs() diff --git a/pdata/pprofile/pb.go b/pdata/pprofile/pb.go index b9c8bacd14c..5da9ceda2f0 100644 --- a/pdata/pprofile/pb.go +++ b/pdata/pprofile/pb.go @@ -5,7 +5,7 @@ package pprofile // import "go.opentelemetry.io/collector/pdata/pprofile" import ( "go.opentelemetry.io/collector/pdata/internal" - otlpprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" ) var _ MarshalSizer = (*ProtoMarshaler)(nil) diff --git a/pdata/pprofile/pb_test.go b/pdata/pprofile/pb_test.go index 622510a629c..a3bb22aa29e 100644 --- a/pdata/pprofile/pb_test.go +++ b/pdata/pprofile/pb_test.go @@ -22,7 +22,6 @@ func TestProtoSizer(t *testing.T) { td.ResourceProfiles().AppendEmpty(). ScopeProfiles().AppendEmpty(). Profiles().AppendEmpty(). - Profile(). StringTable().Append("foobar") size := marshaler.ProfilesSize(td) @@ -66,11 +65,10 @@ func BenchmarkProfilesFromProto(b *testing.B) { func generateBenchmarkProfiles(samplesCount int) Profiles { md := NewProfiles() - ilm := md.ResourceProfiles().AppendEmpty().ScopeProfiles().AppendEmpty().Profiles().AppendEmpty().Profile() + ilm := md.ResourceProfiles().AppendEmpty().ScopeProfiles().AppendEmpty().Profiles().AppendEmpty() ilm.Sample().EnsureCapacity(samplesCount) for i := 0; i < samplesCount; i++ { im := ilm.Sample().AppendEmpty() - im.LocationIndex().Append(1) im.SetLocationsStartIndex(2) im.SetLocationsLength(10) } diff --git a/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess.go b/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess.go index 2bc9e3dab81..284c10f096a 100644 --- a/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess.go +++ b/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess.go @@ -8,7 +8,7 @@ package pprofileotlp import ( "go.opentelemetry.io/collector/pdata/internal" - otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1experimental" + otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1development" ) // ExportPartialSuccess represents the details of a partially successful export request. diff --git a/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess_test.go b/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess_test.go index 73eb11b3026..dea840a8720 100644 --- a/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess_test.go +++ b/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1experimental" + otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1development" ) func TestExportPartialSuccess_MoveTo(t *testing.T) { diff --git a/pdata/pprofile/pprofileotlp/grpc.go b/pdata/pprofile/pprofileotlp/grpc.go index 491f14ec348..cb6c5e8093e 100644 --- a/pdata/pprofile/pprofileotlp/grpc.go +++ b/pdata/pprofile/pprofileotlp/grpc.go @@ -11,7 +11,7 @@ import ( "google.golang.org/grpc/status" "go.opentelemetry.io/collector/pdata/internal" - otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1experimental" + otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1development" "go.opentelemetry.io/collector/pdata/internal/otlp" ) diff --git a/pdata/pprofile/pprofileotlp/request.go b/pdata/pprofile/pprofileotlp/request.go index 200040772e8..8c304944cab 100644 --- a/pdata/pprofile/pprofileotlp/request.go +++ b/pdata/pprofile/pprofileotlp/request.go @@ -7,7 +7,7 @@ import ( "bytes" "go.opentelemetry.io/collector/pdata/internal" - otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1experimental" + otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1development" "go.opentelemetry.io/collector/pdata/internal/json" "go.opentelemetry.io/collector/pdata/internal/otlp" "go.opentelemetry.io/collector/pdata/pprofile" diff --git a/pdata/pprofile/pprofileotlp/request_test.go b/pdata/pprofile/pprofileotlp/request_test.go index 49c19106c9e..d45845c9609 100644 --- a/pdata/pprofile/pprofileotlp/request_test.go +++ b/pdata/pprofile/pprofileotlp/request_test.go @@ -25,15 +25,13 @@ var profilesRequestJSON = []byte(` "scope": {}, "profiles": [ { - "profileId": "", - "profile": { - "sample": [ - { - "locationsStartIndex": "42" - } - ], - "periodType": {} - } + "sample": [ + { + "locationsStartIndex": 42 + } + ], + "periodType": {}, + "profileId": "" } ] } @@ -45,14 +43,14 @@ var profilesRequestJSON = []byte(` func TestRequestToPData(t *testing.T) { tr := NewExportRequest() assert.Equal(t, 0, tr.Profiles().SampleCount()) - tr.Profiles().ResourceProfiles().AppendEmpty().ScopeProfiles().AppendEmpty().Profiles().AppendEmpty().Profile().Sample().AppendEmpty() + tr.Profiles().ResourceProfiles().AppendEmpty().ScopeProfiles().AppendEmpty().Profiles().AppendEmpty().Sample().AppendEmpty() assert.Equal(t, 1, tr.Profiles().SampleCount()) } func TestRequestJSON(t *testing.T) { tr := NewExportRequest() require.NoError(t, tr.UnmarshalJSON(profilesRequestJSON)) - assert.Equal(t, uint64(42), tr.Profiles().ResourceProfiles().At(0).ScopeProfiles().At(0).Profiles().At(0).Profile().Sample().At(0).LocationsStartIndex()) + assert.Equal(t, int32(42), tr.Profiles().ResourceProfiles().At(0).ScopeProfiles().At(0).Profiles().At(0).Sample().At(0).LocationsStartIndex()) got, err := tr.MarshalJSON() require.NoError(t, err) diff --git a/pdata/pprofile/pprofileotlp/response.go b/pdata/pprofile/pprofileotlp/response.go index bfc9d729a7c..5b87f8b3418 100644 --- a/pdata/pprofile/pprofileotlp/response.go +++ b/pdata/pprofile/pprofileotlp/response.go @@ -9,7 +9,7 @@ import ( jsoniter "github.com/json-iterator/go" "go.opentelemetry.io/collector/pdata/internal" - otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1experimental" + otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1development" "go.opentelemetry.io/collector/pdata/internal/json" ) diff --git a/pdata/pprofile/profile.go b/pdata/pprofile/profile.go new file mode 100644 index 00000000000..c83cda2307d --- /dev/null +++ b/pdata/pprofile/profile.go @@ -0,0 +1,19 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pprofile // import "go.opentelemetry.io/collector/pdata/pprofile" + +import "go.opentelemetry.io/collector/pdata/pcommon" + +// EndTime returns the end time associated with this Profile. +// +// Deprecated: [v0.115.0] This field has been removed, and replaced with Duration +func (ms Profile) EndTime() pcommon.Timestamp { + return pcommon.Timestamp(0) +} + +// SetEndTime replaces the end time associated with this Profile. +// +// Deprecated: [v0.115.0] This field has been removed, and replaced with Duration +func (ms Profile) SetEndTime(pcommon.Timestamp) { +} diff --git a/pdata/pprofile/profiles.go b/pdata/pprofile/profiles.go index 35fffca535f..de235a18506 100644 --- a/pdata/pprofile/profiles.go +++ b/pdata/pprofile/profiles.go @@ -5,7 +5,7 @@ package pprofile // import "go.opentelemetry.io/collector/pdata/pprofile" import ( "go.opentelemetry.io/collector/pdata/internal" - otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1experimental" + otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1development" ) // profiles is the top-level struct that is propagated through the profiles pipeline. @@ -60,7 +60,7 @@ func (ms Profiles) SampleCount() int { for j := 0; j < sps.Len(); j++ { pcs := sps.At(j).Profiles() for k := 0; k < pcs.Len(); k++ { - sampleCount += pcs.At(k).Profile().Sample().Len() + sampleCount += pcs.At(k).Sample().Len() } } } diff --git a/pdata/pprofile/profiles_test.go b/pdata/pprofile/profiles_test.go index 5993edd0e5d..f30f1bc1cab 100644 --- a/pdata/pprofile/profiles_test.go +++ b/pdata/pprofile/profiles_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal/data" - otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1experimental" - otlpprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental" + otlpcollectorprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1development" + otlpprofile "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -35,7 +35,7 @@ func TestSampleCount(t *testing.T) { ils := rs.ScopeProfiles().AppendEmpty() assert.EqualValues(t, 0, profiles.SampleCount()) - ps := ils.Profiles().AppendEmpty().Profile() + ps := ils.Profiles().AppendEmpty() assert.EqualValues(t, 0, profiles.SampleCount()) ps.Sample().AppendEmpty() @@ -44,7 +44,7 @@ func TestSampleCount(t *testing.T) { ils2 := rs.ScopeProfiles().AppendEmpty() assert.EqualValues(t, 1, profiles.SampleCount()) - ps2 := ils2.Profiles().AppendEmpty().Profile() + ps2 := ils2.Profiles().AppendEmpty() assert.EqualValues(t, 1, profiles.SampleCount()) ps2.Sample().AppendEmpty() @@ -53,7 +53,7 @@ func TestSampleCount(t *testing.T) { rms := profiles.ResourceProfiles() rms.EnsureCapacity(3) rms.AppendEmpty().ScopeProfiles().AppendEmpty() - ilss := rms.AppendEmpty().ScopeProfiles().AppendEmpty().Profiles().AppendEmpty().Profile().Sample() + ilss := rms.AppendEmpty().ScopeProfiles().AppendEmpty().Profiles().AppendEmpty().Sample() for i := 0; i < 5; i++ { ilss.AppendEmpty() } @@ -77,12 +77,10 @@ func TestSampleCountWithEmpty(t *testing.T) { { ScopeProfiles: []*otlpprofile.ScopeProfiles{ { - Profiles: []*otlpprofile.ProfileContainer{ + Profiles: []*otlpprofile.Profile{ { - Profile: otlpprofile.Profile{ - Sample: []*otlpprofile.Sample{ - {}, - }, + Sample: []*otlpprofile.Sample{ + {}, }, }, }, @@ -122,18 +120,18 @@ func BenchmarkProfilesUsage(b *testing.B) { s := iss.Profiles().At(k) s.SetProfileID(testValProfileID) assert.Equal(b, testValProfileID, s.ProfileID()) - s.SetStartTime(ts) - assert.Equal(b, ts, s.StartTime()) - s.SetEndTime(ts) - assert.Equal(b, ts, s.EndTime()) + s.SetTime(ts) + assert.Equal(b, ts, s.Time()) + s.SetDuration(ts) + assert.Equal(b, ts, s.Duration()) } s := iss.Profiles().AppendEmpty() s.SetProfileID(testSecondValProfileID) - s.SetStartTime(ts) - s.SetEndTime(ts) + s.SetTime(ts) + s.SetDuration(ts) s.Attributes().PutStr("foo1", "bar1") s.Attributes().PutStr("foo2", "bar2") - iss.Profiles().RemoveIf(func(lr ProfileContainer) bool { + iss.Profiles().RemoveIf(func(lr Profile) bool { return lr.ProfileID() == testSecondValProfileID }) } diff --git a/pdata/testdata/profile.go b/pdata/testdata/profile.go index 9a85b3373e0..e67c924f03d 100644 --- a/pdata/testdata/profile.go +++ b/pdata/testdata/profile.go @@ -32,33 +32,35 @@ func GenerateProfiles(profilesCount int) pprofile.Profiles { return td } -func fillProfileOne(profile pprofile.ProfileContainer) { +func fillProfileOne(profile pprofile.Profile) { profile.SetProfileID([16]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10}) - profile.SetStartTime(profileStartTimestamp) - profile.SetEndTime(profileEndTimestamp) + profile.SetTime(profileStartTimestamp) + profile.SetDuration(profileEndTimestamp) profile.SetDroppedAttributesCount(1) - sample := profile.Profile().Sample().AppendEmpty() - sample.LocationIndex().Append(1) + attr := profile.AttributeTable().AppendEmpty() + attr.SetKey("key") + attr.Value().SetStr("value") + + sample := profile.Sample().AppendEmpty() sample.SetLocationsStartIndex(2) sample.SetLocationsLength(10) - sample.SetStacktraceIdIndex(3) sample.Value().Append(4) - sample.SetLink(42) - sample.Attributes().Append(5) + sample.AttributeIndices().Append(0) } -func fillProfileTwo(profile pprofile.ProfileContainer) { +func fillProfileTwo(profile pprofile.Profile) { profile.SetProfileID([16]byte{0x02, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10}) - profile.SetStartTime(profileStartTimestamp) - profile.SetEndTime(profileEndTimestamp) + profile.SetTime(profileStartTimestamp) + profile.SetDuration(profileEndTimestamp) + + attr := profile.AttributeTable().AppendEmpty() + attr.SetKey("key") + attr.Value().SetStr("value") - sample := profile.Profile().Sample().AppendEmpty() - sample.LocationIndex().Append(6) + sample := profile.Sample().AppendEmpty() sample.SetLocationsStartIndex(7) sample.SetLocationsLength(20) - sample.SetStacktraceIdIndex(8) sample.Value().Append(9) - sample.SetLink(44) - sample.Attributes().Append(10) + sample.AttributeIndices().Append(0) } diff --git a/proto_patch.sed b/proto_patch.sed index 831f9a6bad2..fb5160a15b7 100644 --- a/proto_patch.sed +++ b/proto_patch.sed @@ -1,6 +1,6 @@ s+go.opentelemetry.io/proto/otlp/+go.opentelemetry.io/collector/pdata/internal/data/protogen/+g -s+package opentelemetry.proto.\(.*\).v\(.*\);+package opentelemetry.proto.\1.v\2;\ +s+package opentelemetry\.proto\.\(.*\)\.v\(.*\);+package opentelemetry.proto.\1.v\2;\ \ import "gogoproto/gogo.proto";+g @@ -51,7 +51,7 @@ s+\(.*\)PartialSuccess partial_success = \(.*\);+\1PartialSuccess partial_succes # # Profiles replacements # -s+opentelemetry.proto.profiles.v1experimental.Profile \(.*\);+opentelemetry.proto.profiles.v1experimental.Profile \1\ +s+opentelemetry.proto.profiles.v1development.Profile \(.*\);+opentelemetry.proto.profiles.v1development.Profile \1\ [ (gogoproto.nullable) = false ];+g s+bytes profile_id = \(.*\);+bytes profile_id = \1\ From c52d625647be61f6b507a216a557b8aa0c70fb22 Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Sat, 30 Nov 2024 18:12:27 +0100 Subject: [PATCH 6/6] [chore] Remove references to component.UseLocalHostAsDefaultHost (#11773) #### Description Follows #11235, relates to #8510 --- docs/security-best-practices.md | 5 +---- receiver/otlpreceiver/README.md | 6 +++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/docs/security-best-practices.md b/docs/security-best-practices.md index a4bd7fdcb14..710d82f221a 100644 --- a/docs/security-best-practices.md +++ b/docs/security-best-practices.md @@ -148,9 +148,6 @@ receivers: Generally, `localhost`-like addresses should be preferred over the 0.0.0.0 address. For more information, see [CWE-1327](https://cwe.mitre.org/data/definitions/1327.html). -To change the default endpoint to be `localhost`-bound in all components, enable the `component.UseLocalHostAsDefaultHost` feature gate. This feature gate will be enabled by default in the Collector in a future release. - - If `localhost` resolves to a different IP due to your DNS settings then explicitly use the loopback IP instead: `127.0.0.1` for IPv4 or `::1` for IPv6. In IPv6 setups, ensure your system supports both IPv4 and IPv6 loopback addresses to avoid issues. Using `localhost` may not work in environments like Docker, Kubernetes, and other environments that have non-standard networking setups. We've documented a few working example setups for the OTLP receiver gRPC endpoint below, but other receivers and other Collector components may need similar configuration. @@ -324,4 +321,4 @@ Extensions may also be used to run subprocesses. This can be useful when collection mechanisms that cannot natively be run by the Collector (e.g. FluentBit). Subprocesses expose a completely separate attack vector that would depend on the subprocess itself. In general, care should be taken before -running any subprocesses alongside the Collector. \ No newline at end of file +running any subprocesses alongside the Collector. diff --git a/receiver/otlpreceiver/README.md b/receiver/otlpreceiver/README.md index 1f3f2c1d3e9..aab0d924148 100644 --- a/receiver/otlpreceiver/README.md +++ b/receiver/otlpreceiver/README.md @@ -40,9 +40,9 @@ The following settings are configurable: - `endpoint` (default = localhost:4317 for grpc protocol, localhost:4318 http protocol): host:port to which the receiver is going to receive data. The valid syntax is - described at https://github.com/grpc/grpc/blob/master/doc/naming.md. The - `component.UseLocalHostAsDefaultHost` feature gate changes these to localhost:4317 and - localhost:4318 respectively. This will become the default in a future release. + described at https://github.com/grpc/grpc/blob/master/doc/naming.md. See our + [security best practices doc](https://opentelemetry.io/docs/security/config-best-practices/#protect-against-denial-of-service-attacks) + to understand how to set the endpoint in different environments. ## Advanced Configuration