Use the apm-server version everywhere*#4725
Merged
axw merged 3 commits intoelastic:masterfrom Feb 15, 2021
Merged
Conversation
Instead of hardcoding the major version, parse the full version.
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪Steps errors
Expand to view the steps failures
|
Rather than returning the libbeat version from the root/healthcheck handler, inject the apm-server version so it can be returned. Also, in the integration tests use a hard-coded version "1.2.3", so we don't have to change approval files each time we bump the version. This should enable us to automate the version bump.
b2be4bb to
7e9243f
Compare
Member
Author
Having said that, it would be better if we passed the version in. That way we could better unit test the behaviour. |
jalvz
approved these changes
Feb 15, 2021
Codecov Report
@@ Coverage Diff @@
## master #4725 +/- ##
==========================================
- Coverage 76.43% 76.43% -0.01%
==========================================
Files 165 165
Lines 10076 10083 +7
==========================================
+ Hits 7702 7707 +5
- Misses 2374 2376 +2
|
axw
added a commit
to axw/apm-server
that referenced
this pull request
Feb 19, 2021
* publish: parse version to set version_major Instead of hardcoding the major version, parse the full version. * beater: pass apm-server version into root handler Rather than returning the libbeat version from the root/healthcheck handler, inject the apm-server version so it can be returned. Also, in the integration tests use a hard-coded version "1.2.3", so we don't have to change approval files each time we bump the version. This should enable us to automate the version bump. # Conflicts: # beater/api/mux.go # beater/api/root/test_approved/integration/TestRootHandler_AuthorizationMiddleware/Authorized.approved.json # beater/test_approved_es_documents/TestPublishIntegrationErrors.approved.json # beater/test_approved_es_documents/TestPublishIntegrationEvents.approved.json # beater/test_approved_es_documents/TestPublishIntegrationMetricsets.approved.json # beater/test_approved_es_documents/TestPublishIntegrationMinimalEvents.approved.json # beater/test_approved_es_documents/TestPublishIntegrationProfileCPUProfile.approved.json # beater/test_approved_es_documents/TestPublishIntegrationProfileCPUProfileMetadata.approved.json # beater/test_approved_es_documents/TestPublishIntegrationProfileHeapProfile.approved.json # beater/test_approved_es_documents/TestPublishIntegrationSpans.approved.json # beater/test_approved_es_documents/TestPublishIntegrationTransactions.approved.json # publish/pub.go
axw
added a commit
to axw/apm-server
that referenced
this pull request
Feb 19, 2021
* publish: parse version to set version_major Instead of hardcoding the major version, parse the full version. * beater: pass apm-server version into root handler Rather than returning the libbeat version from the root/healthcheck handler, inject the apm-server version so it can be returned. Also, in the integration tests use a hard-coded version "1.2.3", so we don't have to change approval files each time we bump the version. This should enable us to automate the version bump. # Conflicts: # beater/api/mux.go # beater/api/root/test_approved/integration/TestRootHandler_AuthorizationMiddleware/Authorized.approved.json # beater/test_approved_es_documents/TestPublishIntegrationErrors.approved.json # beater/test_approved_es_documents/TestPublishIntegrationEvents.approved.json # beater/test_approved_es_documents/TestPublishIntegrationMetricsets.approved.json # beater/test_approved_es_documents/TestPublishIntegrationMinimalEvents.approved.json # beater/test_approved_es_documents/TestPublishIntegrationProfileCPUProfile.approved.json # beater/test_approved_es_documents/TestPublishIntegrationProfileCPUProfileMetadata.approved.json # beater/test_approved_es_documents/TestPublishIntegrationProfileHeapProfile.approved.json # beater/test_approved_es_documents/TestPublishIntegrationSpans.approved.json # beater/test_approved_es_documents/TestPublishIntegrationTransactions.approved.json # publish/pub.go
axw
added a commit
that referenced
this pull request
Feb 19, 2021
* publish: parse version to set version_major Instead of hardcoding the major version, parse the full version. * beater: pass apm-server version into root handler Rather than returning the libbeat version from the root/healthcheck handler, inject the apm-server version so it can be returned. Also, in the integration tests use a hard-coded version "1.2.3", so we don't have to change approval files each time we bump the version. This should enable us to automate the version bump. # Conflicts: # beater/api/mux.go # beater/api/root/test_approved/integration/TestRootHandler_AuthorizationMiddleware/Authorized.approved.json # beater/test_approved_es_documents/TestPublishIntegrationErrors.approved.json # beater/test_approved_es_documents/TestPublishIntegrationEvents.approved.json # beater/test_approved_es_documents/TestPublishIntegrationMetricsets.approved.json # beater/test_approved_es_documents/TestPublishIntegrationMinimalEvents.approved.json # beater/test_approved_es_documents/TestPublishIntegrationProfileCPUProfile.approved.json # beater/test_approved_es_documents/TestPublishIntegrationProfileCPUProfileMetadata.approved.json # beater/test_approved_es_documents/TestPublishIntegrationProfileHeapProfile.approved.json # beater/test_approved_es_documents/TestPublishIntegrationSpans.approved.json # beater/test_approved_es_documents/TestPublishIntegrationTransactions.approved.json # publish/pub.go
axw
added a commit
that referenced
this pull request
Feb 19, 2021
* publish: parse version to set version_major Instead of hardcoding the major version, parse the full version. * beater: pass apm-server version into root handler Rather than returning the libbeat version from the root/healthcheck handler, inject the apm-server version so it can be returned. Also, in the integration tests use a hard-coded version "1.2.3", so we don't have to change approval files each time we bump the version. This should enable us to automate the version bump. # Conflicts: # beater/api/mux.go # beater/api/root/test_approved/integration/TestRootHandler_AuthorizationMiddleware/Authorized.approved.json # beater/test_approved_es_documents/TestPublishIntegrationErrors.approved.json # beater/test_approved_es_documents/TestPublishIntegrationEvents.approved.json # beater/test_approved_es_documents/TestPublishIntegrationMetricsets.approved.json # beater/test_approved_es_documents/TestPublishIntegrationMinimalEvents.approved.json # beater/test_approved_es_documents/TestPublishIntegrationProfileCPUProfile.approved.json # beater/test_approved_es_documents/TestPublishIntegrationProfileCPUProfileMetadata.approved.json # beater/test_approved_es_documents/TestPublishIntegrationProfileHeapProfile.approved.json # beater/test_approved_es_documents/TestPublishIntegrationSpans.approved.json # beater/test_approved_es_documents/TestPublishIntegrationTransactions.approved.json # publish/pub.go
This was referenced Feb 19, 2021
v1v
added a commit
to v1v/apm-server
that referenced
this pull request
Feb 22, 2021
…chemas-to-agents * upstream/master: (111 commits) Introduce metricset.name (elastic#4857) processor/otel: test service.version handling (elastic#4853) docs: Add PHP agent information to shared docs (elastic#4740) Script for faster development workflow (elastic#4731) Update to elastic/beats@1b31c26 (elastic#4763) backport: add 7.12 to .backportrc.json (elastic#4807) backport: enable auto-merge on backport PRs (elastic#4777) Support for Node.js profiles (elastic#4728) docs: readds .NET link (elastic#4764) [DOCS] Fixes URLs on Secure communication with APM Agents page (elastic#4746) ci: set proper parameters for the tar step (elastic#4696) docs: add 7.11.1 release notes (elastic#4727) Disable sourcemap upload endpoint when data streams enabled (elastic#4735) Add service name to dataset field (elastic#4674) Update to elastic/beats@ba423212a660 (elastic#4733) sampling: require a default policy (elastic#4729) processor/otel: add unit test for span status (elastic#4734) Add support for consuming OTLP/gRPC metrics (elastic#4722) [apmpackage] Add config options supported in ESS (elastic#4690) Use the apm-server version everywhere* (elastic#4725) ...
v1v
added a commit
to v1v/apm-server
that referenced
this pull request
Feb 22, 2021
…te-schema-json-1 * upstream/master: (111 commits) Introduce metricset.name (elastic#4857) processor/otel: test service.version handling (elastic#4853) docs: Add PHP agent information to shared docs (elastic#4740) Script for faster development workflow (elastic#4731) Update to elastic/beats@1b31c26 (elastic#4763) backport: add 7.12 to .backportrc.json (elastic#4807) backport: enable auto-merge on backport PRs (elastic#4777) Support for Node.js profiles (elastic#4728) docs: readds .NET link (elastic#4764) [DOCS] Fixes URLs on Secure communication with APM Agents page (elastic#4746) ci: set proper parameters for the tar step (elastic#4696) docs: add 7.11.1 release notes (elastic#4727) Disable sourcemap upload endpoint when data streams enabled (elastic#4735) Add service name to dataset field (elastic#4674) Update to elastic/beats@ba423212a660 (elastic#4733) sampling: require a default policy (elastic#4729) processor/otel: add unit test for span status (elastic#4734) Add support for consuming OTLP/gRPC metrics (elastic#4722) [apmpackage] Add config options supported in ESS (elastic#4690) Use the apm-server version everywhere* (elastic#4725) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation/summary
We have been using the libbeat version in the root handler,
which may not be the same as the apm-server version since
we maintain our own version now. This PR injects the apm-server
version into the root handler so it can be returned.
In the publisher code, we had hard-coded the major version
number. Less problematic, but I have changed this to parse the
full version to extract the major version number.
In the Elasticsearch client we still use the libbeat version for
determining the major version number. I think this is OK because
we should never have different major version of libbeat in
APM Server, for the time being at least.
Finally: instead of using the libbeat version in integration tests,
use a hard-coded version of "1.2.3" so we don't have to change
approval files each time we bump the version. This should enable
us to automate the version bump.
Checklist
- [ ] Update CHANGELOG.asciidocshould have no visible impact on users, as we have kept libbeat up to date.- [ ] Documentation has been updatedHow to test these changes
Related issues
Fixes #4420