Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make OTLP input return partial success response #11883

Merged
merged 6 commits into from
Oct 24, 2023

Conversation

carsonip
Copy link
Member

@carsonip carsonip commented Oct 18, 2023

Motivation/summary

Make OTLP input return partial success response.

elastic/apm-data#156
elastic/apm-data#172

Checklist

For functional changes, consider:

  • Is it observable through the addition of either logging or metrics?
  • Is its use being published in telemetry to enable product improvement?
  • Have system tests been added to avoid regression?

How to test these changes

Send otel metrics with exponential histogram and observe partial success response.

Related issues

@mergify
Copy link
Contributor

mergify bot commented Oct 18, 2023

This pull request is now in conflicts. Could you fix it @carsonip? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b bump-apm-data upstream/bump-apm-data
git merge upstream/main
git push upstream bump-apm-data

@mergify
Copy link
Contributor

mergify bot commented Oct 18, 2023

This pull request does not have a backport label. Could you fix it @carsonip? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-7.17 is the label to automatically backport to the 7.17 branch.
  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Oct 18, 2023
@carsonip carsonip marked this pull request as ready for review October 19, 2023 10:58
@carsonip carsonip requested a review from a team as a code owner October 19, 2023 10:58
@carsonip carsonip requested review from axw and kruskall October 19, 2023 12:03
@carsonip carsonip merged commit 935754d into elastic:main Oct 24, 2023
11 checks passed
@kyungeunni kyungeunni assigned kyungeunni and unassigned kyungeunni Dec 20, 2023
@kyungeunni kyungeunni self-assigned this Dec 29, 2023
@kyungeunni
Copy link
Contributor

kyungeunni commented Dec 29, 2023

Ran a couple of OTEL collectors, and configured them to target 8.12 and a prior version(8.8) respectively.

Sent following payload to trigger partial success response(modified version of this example):

{
  "resourceMetrics": [
    {
      "resource": {
        "attributes": [
          {
            "key": "service.name",
            "value": {
              "stringValue": "my.service"
            }
          }
        ]
      },
      "scopeMetrics": [
        {
          "scope": {
            "name": "my.library",
            "version": "1.0.0",
            "attributes": [
              {
                "key": "my.scope.attribute",
                "value": {
                  "stringValue": "some scope attribute"
                }
              }
            ]
          },
          "metrics": [
            {
              "name": "my.counter",
              "unit": "1",
              "description": "I am a Counter",
              "sum": {
                "aggregationTemporality": 1,
                "isMonotonic": true,
                "dataPoints": [
                  {
                    "asDouble": 5,
                    "startTimeUnixNano": 1544712660300000000,
                    "timeUnixNano": 1544712660300000000,
                    "attributes": [
                      {
                        "key": "my.counter.attr",
                        "value": {
                          "stringValue": "some value"
                        }
                      }
                    ]
                  }
                ]
              }
            },
            {
              "name": "my.gauge",
              "unit": "1",
              "description": "I am a Gauge",
              "gauge": {
                "dataPoints": [
                  {
                    "asDouble": 10,
                    "timeUnixNano": 1544712660300000000,
                    "attributes": [
                      {
                        "key": "my.gauge.attr",
                        "value": {
                          "stringValue": "some value"
                        }
                      }
                    ]
                  }
                ]
              }
            },
            {
              "name": "my.histogram",
              "unit": "1",
              "description": "I am a Histogram",
              "exponentialHistogram": {
                "aggregationTemporality": 1,
                "dataPoints": [
                  {
                    "startTimeUnixNano": 1544712660300000000,
                    "timeUnixNano": 1544712660300000000,
                    "count": 4,
                    "sum": 2,
                    "bucketCounts": [1,123,1024,2000],
                    "explicitBounds": [1],
                    "min": 0,
                    "max": 5,
										"maxScale": -10,
                    "attributes": [
                      {
                        "key": "my.histogram.attr",
                        "value": {
                          "stringValue": "some value"
                        }
                      }
                    ]
                  }
                ]
              }
            }
          ]
        }
      ]
    }
  ]
}

Collector logs showing different results:

APM Server v8.12.0:

2023-12-29 13:52:40 Descriptor:
2023-12-29 13:52:40      -> Name: my.histogram
2023-12-29 13:52:40      -> Description: I am a Histogram
2023-12-29 13:52:40      -> Unit: 1
2023-12-29 13:52:40      -> DataType: ExponentialHistogram
2023-12-29 13:52:40      -> AggregationTemporality: Delta
2023-12-29 13:52:40 ExponentialHistogramDataPoints #0
2023-12-29 13:52:40 Data point attributes:
2023-12-29 13:52:40      -> my.histogram.attr: Str(some value)
2023-12-29 13:52:40 StartTimestamp: 2018-12-13 14:51:00.3 +0000 UTC
2023-12-29 13:52:40 Timestamp: 2018-12-13 14:51:00.3 +0000 UTC
2023-12-29 13:52:40 Count: 4
2023-12-29 13:52:40 Sum: 2.000000
2023-12-29 13:52:40 Min: 0.000000
2023-12-29 13:52:40 Max: 5.000000
2023-12-29 13:52:40     {"kind": "exporter", "data_type": "metrics", "name": "logging"}
2023-12-29 13:52:40 2023-12-29T04:52:40.220Z    error   exporterhelper/retry_sender.go:126      Exporting failed. The error is not retryable. Dropping data.    {"kind": "exporter", "data_type": "metrics", "name": "otlp/elastic", "error": "Permanent error: OTLP partial success: \"unsupported data points\" (1 rejected)", "dropped_items": 3}

APM Server v8.8 (Prior to the change)

2023-12-29 13:53:33 Descriptor:
2023-12-29 13:53:33      -> Name: my.histogram
2023-12-29 13:53:33      -> Description: I am a Histogram
2023-12-29 13:53:33      -> Unit: 1
2023-12-29 13:53:33      -> DataType: ExponentialHistogram
2023-12-29 13:53:33      -> AggregationTemporality: Delta
2023-12-29 13:53:33 ExponentialHistogramDataPoints #0
2023-12-29 13:53:33 Data point attributes:
2023-12-29 13:53:33      -> my.histogram.attr: Str(some value)
2023-12-29 13:53:33 StartTimestamp: 2018-12-13 14:51:00.3 +0000 UTC
2023-12-29 13:53:33 Timestamp: 2018-12-13 14:51:00.3 +0000 UTC
2023-12-29 13:53:33 Count: 4
2023-12-29 13:53:33 Sum: 2.000000
2023-12-29 13:53:33 Min: 0.000000
2023-12-29 13:53:33 Max: 5.000000
2023-12-29 13:53:33     {"kind": "exporter", "data_type": "metrics", "name": "logging"}

Before the change, the partial success was silently ignored and the result wasn't returned to the sender, but APM Server returns a partial success response since 8.12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip Skip notification from the automated backport with mergify test-plan test-plan-ok v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants