Skip to content

Commit

Permalink
Merge branch 'main' into limit-reload-delay
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonip authored Oct 14, 2024
2 parents 21d0f48 + 5cd8b7d commit d38d5d4
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 17 deletions.
1 change: 1 addition & 0 deletions changelogs/head.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ https://github.com/elastic/apm-server/compare/8.15\...main[View commits]
==== Bug fixes

- Track all bulk request response status codes {pull}13574[13574]
- Fix a concurrent map write panic in monitoring middleware {pull}14335[14335]
- Apply shutdown timeout to http server {pull}14339[14339]

[float]
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ x-logging: &default-logging
services:
elasticsearch:
# TODO: replace with a pinned version such as 9.0.0-aaaaaaaa-SNAPSHOT
image: docker.elastic.co/elasticsearch/elasticsearch:9.0.0-532d78c6-SNAPSHOT
image: docker.elastic.co/elasticsearch/elasticsearch:9.0.0-9b4a1f9a-SNAPSHOT
ports:
- 9200:9200
healthcheck:
Expand Down Expand Up @@ -43,7 +43,7 @@ services:

kibana:
# TODO: replace with a pinned version such as 9.0.0-aaaaaaaa-SNAPSHOT
image: docker.elastic.co/kibana/kibana:9.0.0-532d78c6-SNAPSHOT
image: docker.elastic.co/kibana/kibana:9.0.0-9b4a1f9a-SNAPSHOT
ports:
- 5601:5601
healthcheck:
Expand All @@ -63,7 +63,7 @@ services:

metricbeat:
# TODO: replace with a pinned version such as 9.0.0-aaaaaaaa-SNAPSHOT
image: docker.elastic.co/beats/metricbeat:9.0.0-532d78c6-SNAPSHOT
image: docker.elastic.co/beats/metricbeat:9.0.0-9b4a1f9a-SNAPSHOT
environment:
ELASTICSEARCH_HOSTS: '["http://elasticsearch:9200"]'
ELASTICSEARCH_USERNAME: "${KIBANA_ES_USER:-admin}"
Expand Down
21 changes: 11 additions & 10 deletions internal/beater/middleware/monitoring_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package middleware
import (
"context"
"net/http"
"sync"
"time"

"go.opentelemetry.io/otel"
Expand All @@ -37,8 +38,8 @@ type monitoringMiddleware struct {
meter metric.Meter

ints map[request.ResultID]*monitoring.Int
counters map[string]metric.Int64Counter
histograms map[string]metric.Int64Histogram
counters sync.Map
histograms sync.Map
}

func (m *monitoringMiddleware) Middleware() Middleware {
Expand Down Expand Up @@ -79,23 +80,23 @@ func (m *monitoringMiddleware) inc(id request.ResultID) {

func (m *monitoringMiddleware) getCounter(n string) metric.Int64Counter {
name := "http.server." + n
if met, ok := m.counters[name]; ok {
return met
if met, ok := m.counters.Load(name); ok {
return met.(metric.Int64Counter)
}

nm, _ := m.meter.Int64Counter(name)
m.counters[name] = nm
m.counters.LoadOrStore(name, nm)
return nm
}

func (m *monitoringMiddleware) getHistogram(n string, opts ...metric.Int64HistogramOption) metric.Int64Histogram {
name := "http.server." + n
if met, ok := m.histograms[name]; ok {
return met
if met, ok := m.histograms.Load(name); ok {
return met.(metric.Int64Histogram)
}

nm, _ := m.meter.Int64Histogram(name, opts...)
m.histograms[name] = nm
m.histograms.LoadOrStore(name, nm)
return nm
}

Expand All @@ -109,8 +110,8 @@ func MonitoringMiddleware(m map[request.ResultID]*monitoring.Int, mp metric.Mete
mid := &monitoringMiddleware{
meter: mp.Meter("internal/beater/middleware"),
ints: m,
counters: map[string]metric.Int64Counter{},
histograms: map[string]metric.Int64Histogram{},
counters: sync.Map{},
histograms: sync.Map{},
}

return mid.Middleware()
Expand Down
2 changes: 1 addition & 1 deletion testing/benchmark/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ output "apm_server_ip" {
}

output "admin_console_url" {
value = var.run_standalone ? "" : module.ec_deployment[0].admin_console_url
value = var.run_standalone ? "https://cloud.elastic.co/deployments" : module.ec_deployment[0].admin_console_url
description = "The admin console URL"
}
2 changes: 1 addition & 1 deletion testing/infra/k8s/base/stack/apm-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: apm-server
spec:
# TODO: replace with a pinned version such as 9.0.0-aaaaaaaa-SNAPSHOT
version: 9.0.0-532d78c6-SNAPSHOT
version: 9.0.0-9b4a1f9a-SNAPSHOT
count: 1
http:
tls:
Expand Down
2 changes: 1 addition & 1 deletion testing/infra/k8s/base/stack/elasticsearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: elasticsearch
spec:
# TODO: replace with a pinned version such as 9.0.0-aaaaaaaa-SNAPSHOT
version: 9.0.0-532d78c6-SNAPSHOT
version: 9.0.0-9b4a1f9a-SNAPSHOT
auth:
fileRealm:
- secretName: elasticsearch-admin
Expand Down
2 changes: 1 addition & 1 deletion testing/infra/k8s/base/stack/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: kibana
spec:
# TODO: replace with a pinned version such as 9.0.0-aaaaaaaa-SNAPSHOT
version: 9.0.0-532d78c6-SNAPSHOT
version: 9.0.0-9b4a1f9a-SNAPSHOT
count: 1
elasticsearchRef:
name: elasticsearch
Expand Down
Binary file modified x-pack/apm-server/default.pgo
Binary file not shown.

0 comments on commit d38d5d4

Please sign in to comment.