Skip to content

Commit

Permalink
Merge branch 'main' into ptodev/upgrade-ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
thampiotr authored Aug 13, 2024
2 parents a62983f + 0ea8f05 commit d6f62fb
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 9 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Main (unreleased)
used as a temporary measure, since this flag will be disabled in future
releases. (@thampiotr)

- Added a new panel to Cluster Overview dashboard to show the number of peers
seen by each instance in the cluster. This can help diagnose cluster split
brain issues. (@thampiotr)

### Bugfixes

- Fixed an issue which caused loss of context data in Faro exception. (@codecapitano)
Expand All @@ -34,7 +38,8 @@ Main (unreleased)
- Fixed an issue where clustering peers resolution via hostname in `--cluster.join-addresses`
resolves to duplicated IP addresses when using SRV records. (@thampiotr)

### Other changes
- Fixed an issue where the `connection_string` for the `loki.source.azure_event_hubs` component
was displayed in the UI in plaintext. (@MorrisWitthein)

- Change the Docker base image for Linux containers to `ubuntu:noble`. (@ptodev)

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/data-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ All newly reported data is documented in the CHANGELOG.

## Opt-out of data collection

You can use the `-disable-reporting` [command line flag][] to disable the reporting and opt-out of the data collection.
You can use the `--disable-reporting` [command line flag][] to disable the reporting and opt-out of the data collection.

[components]: ../get-started/components
[command line flag]: ../reference/cli/run
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ The `authentication` block defines the authentication method when communicating
Name | Type | Description | Default | Required
--------------------|----------------|---------------------------------------------------------------------------|---------|---------
`mechanism` | `string` | Authentication mechanism. | | yes
`connection_string` | `string` | Event Hubs ConnectionString for authentication on Azure Cloud. | | no
`connection_string` | `secret` | Event Hubs ConnectionString for authentication on Azure Cloud. | | no
`scopes` | `list(string)` | Access token scopes. Default is `fully_qualified_namespace` without port. | | no

`mechanism` supports the values `"connection_string"` and `"oauth"`. If `"connection_string"` is used,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
kt "github.com/grafana/alloy/internal/component/loki/source/internal/kafkatarget"
"github.com/grafana/alloy/internal/featuregate"
"github.com/grafana/alloy/internal/runtime/logging/level"
"github.com/grafana/alloy/syntax/alloytypes"
"github.com/grafana/dskit/flagext"

"github.com/prometheus/common/model"
Expand Down Expand Up @@ -50,9 +51,9 @@ type Arguments struct {

// AzureEventHubsAuthentication describe the configuration for authentication with Azure Event Hub
type AzureEventHubsAuthentication struct {
Mechanism string `alloy:"mechanism,attr"`
Scopes []string `alloy:"scopes,attr,optional"`
ConnectionString string `alloy:"connection_string,attr,optional"`
Mechanism string `alloy:"mechanism,attr"`
Scopes []string `alloy:"scopes,attr,optional"`
ConnectionString alloytypes.Secret `alloy:"connection_string,attr,optional"`
}

func getDefault() Arguments {
Expand Down Expand Up @@ -184,7 +185,7 @@ func (a *Arguments) Convert() (kt.Config, error) {
SASLConfig: kt.SASLConfig{
UseTLS: true,
User: "$ConnectionString",
Password: flagext.SecretWithValue(a.Authentication.ConnectionString),
Password: flagext.SecretWithValue(string(a.Authentication.ConnectionString)),
Mechanism: sarama.SASLTypePlaintext,
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/grafana/alloy/internal/component/common/relabel"
"github.com/grafana/alloy/internal/component/loki/source/azure_event_hubs"
"github.com/grafana/alloy/internal/converter/internal/common"
"github.com/grafana/alloy/syntax/alloytypes"
)

func (s *ScrapeConfigBuilder) AppendAzureEventHubs() {
Expand All @@ -15,7 +16,7 @@ func (s *ScrapeConfigBuilder) AppendAzureEventHubs() {
FullyQualifiedNamespace: aCfg.FullyQualifiedNamespace,
EventHubs: aCfg.EventHubs,
Authentication: azure_event_hubs.AzureEventHubsAuthentication{
ConnectionString: aCfg.ConnectionString,
ConnectionString: alloytypes.Secret(aCfg.ConnectionString),
},
GroupID: aCfg.GroupID,
UseIncomingTimestamp: aCfg.UseIncomingTimestamp,
Expand All @@ -25,9 +26,11 @@ func (s *ScrapeConfigBuilder) AppendAzureEventHubs() {
ForwardTo: s.getOrNewProcessStageReceivers(),
}
override := func(val interface{}) interface{} {
switch val.(type) {
switch value := val.(type) {
case relabel.Rules:
return common.CustomTokenizer{Expr: s.getOrNewDiscoveryRelabelRules()}
case alloytypes.Secret:
return string(value)
default:
return val
}
Expand Down
25 changes: 25 additions & 0 deletions operations/alloy-mixin/dashboards/cluster-overview.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -225,5 +225,30 @@ local cluster_node_filename = 'alloy-cluster-node.json';
},
])
),

// Number of peers as seen by each instance.
(
panel.new(title='Number of peers seen by each instance', type='timeseries') +
panel.withUnit('peers') +
panel.withDescription(|||
The number of cluster peers seen by each instance.
When cluster is converged, every peer should see all the other instances. When we have a split brain or one
peer not joining the cluster, we will see two or more groups of instances that report different peer numbers
for an extended period of time and not converging.
This graph helps to identify which instances may be in a split brain state.
|||) +
panel.withPosition({ h: 12, w: 24, x: 0, y: 18 }) +
panel.withQueries([
panel.newQuery(
expr= |||
sum by(instance) (cluster_node_peers{%(groupSelector)s})
||| % $._config,
legendFormat='{{instance}}',
),
])
),

]),
}

0 comments on commit d6f62fb

Please sign in to comment.