Skip to content

Conversation

@tiedotguy
Copy link
Collaborator

This is the current "big" thing that I'm aware of blocking clustering, 'cause it interferes with loop detection.

As usual, commits are relatively stand-alone.

@mwhittington21 - if you could get a chance to test this at some point (I'll release it as 28.3.0-rc1), that would be much appreciated. I generally soak changes locally, but I can only validate this one with tests.


All configuration is in a stanza named after the backend, and takes simple key value pairs.

**Cloud providers should be disabled on the aggregation server when using http forwarding, as the source IP isn't
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe technically this became safe with #330

metric_map.go Outdated
}

// AsMetrics will synthesize Metrics from the MetricMap and return them as a slice
// TODO: Remove this function, it only supports tests now
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll raise an issue after this is merged.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth adding a

// deprecated: Used only for testing

To help with IDE highlighters?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Does your IDE use deprecated or Deprecated? Goland seems to want the D or it won't highlight it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Goland has a "deprecate harder", for when the symbol is actually intended to be removed, but damned if I can find the comment syntax for that.

func (ch *CloudHandler) handleInstanceInfo(ctx context.Context, info gostatsd.InstanceInfo) {
metrics := ch.awaitingMetrics[info.IP]
if len(metrics) > 0 {
mm := ch.awaitingMetrics[info.IP]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someone plz double check my logic here:

  • Metric comes in, goes to handleIncomingMetrics
  • statsMetricHostsQueued is incremented because the host isn't in awaitingMetrics or awaitingEvents
  • Event comes in, goes to handleIncomingEvent
  • statsEventHostsQueued is not incremented because the host is in awaitingMetrics
  • Lookup completes
  • handleInstanceInfo sees the IP in awaitingMetrics, decrements statsMetricHostsQueued
  • handleInstanceInfo sees the IP in awaitingEvents, decrements statsEventHostsQueued , it's now -1

I think the situation occurred in both the old logic, and this new code? I'm inclined to think we should just drop both and use a single hostsQueued (or even just a len(toLookupIPs))?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This potentially problematic logic can be ignored, there's a refactor queued up which addresses it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I look forward to the update.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I look forward to merging my third tweaking of this branch in to this once this branch is merged to master :okay:

}

// DispatchMetricMap re-dispatches a MetricMap through CloudHandler.processMetrics
// TODO: This is inefficient, and should be handled first class, however that is a major re-factor of
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is a major re-factor

so that was a lie

@mwhittington21
Copy link
Contributor

@tiedotguy I'll try and find some time to upgrade the clusters. A bit swamped right now, but I'll get to it asap.

return Counter{Value: value, Timestamp: timestamp, Source: source, Tags: tags.Copy()}
}

func (c *Counter) AddTagsSetSource(additionalTags Tags, newSource Source) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this operation need to be threadsafe?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope

@tiedotguy tiedotguy force-pushed the tdg/update-cloudhandler-dispatchmetricmap branch from 29c83f8 to ef0db6a Compare August 26, 2020 00:30
@tiedotguy tiedotguy force-pushed the tdg/update-cloudhandler-dispatchmetricmap branch from ef0db6a to a1f1353 Compare November 30, 2020 06:55
@tiedotguy
Copy link
Collaborator Author

:bueller:

MovieStoreGuy
MovieStoreGuy previously approved these changes Jan 3, 2021
metric_map.go Outdated
}

// AsMetrics will synthesize Metrics from the MetricMap and return them as a slice
// TODO: Remove this function, it only supports tests now
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth adding a

// deprecated: Used only for testing

To help with IDE highlighters?

if ch.updateTagsAndHostname(m, m.Source) {
mmToDispatch.Receive(m)
mmToHandle := gostatsd.NewMetricMap()
mm.Counters.Each(func(metricName string, tagsKey string, c gostatsd.Counter) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the pointer of the values be passed in here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean like:

	mm.Counters.Each(func(metricName string, tagsKey string, c *gostatsd.Counter) {

...?

If so, no - a MetricMap is all structs, not pointers to structs.

func (ch *CloudHandler) handleInstanceInfo(ctx context.Context, info gostatsd.InstanceInfo) {
metrics := ch.awaitingMetrics[info.IP]
if len(metrics) > 0 {
mm := ch.awaitingMetrics[info.IP]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I look forward to the update.

@tiedotguy tiedotguy merged commit 07e3525 into master Jan 20, 2021
@tiedotguy tiedotguy deleted the tdg/update-cloudhandler-dispatchmetricmap branch January 20, 2021 03:15
tiedotguy added a commit that referenced this pull request Jan 20, 2021
Instead of having a per source for metrics queue and a per source for
events queue, this unifies it in to a single per host for anything queue.

This simplifies the logic, and removes what appears to be a logic bug:
#341 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants