Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Initial fakemetrics parrot work. #1665

Closed
wants to merge 7 commits into from
Closed

Initial fakemetrics parrot work. #1665

wants to merge 7 commits into from

Conversation

fitzoh
Copy link
Contributor

@fitzoh fitzoh commented Feb 6, 2020

Currently generates deterministic metrics for each metrictank partition, but does not yet validate them.

Checks are probably going to fail initially due to doc checks, gonna hold off on generating them initially.

Currently generates deterministic metrics for each metrictank partition, but does not yet validate them.
@fitzoh fitzoh requested a review from a team February 6, 2020 09:01

func init() {
rootCmd.AddCommand(parrotCmd)
parrotCmd.Flags().IntVar(&parrotOrgId, "parrot-org-id", 1, "org id to publish parrot metrics to")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does this make more sense as a default than not setting an org ID?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Related: I've made the assumption that we're only going to send parrot metrics to a single org.

This disallows partitioning by org.

Copy link
Contributor

Choose a reason for hiding this comment

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

1 is a fine default. single org is fine too I think.

func init() {
rootCmd.AddCommand(parrotCmd)
parrotCmd.Flags().IntVar(&parrotOrgId, "parrot-org-id", 1, "org id to publish parrot metrics to")
parrotCmd.Flags().Int32Var(&parrotPartitionCount, "parrot-partition-count", 128, "number of partitions to publish parrot metrics to")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So the partition count is a little tricky.

If we're using mt-gateway (which I think is the primary intended use case), we need to pass it in as a flag.

If we're using kafka, we should really probably have a way to discover it via kafka. Does it make sense to disable kafka as an output?

Copy link
Contributor

@Dieterbe Dieterbe Feb 6, 2020

Choose a reason for hiding this comment

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

for now we can keep it simple and don't do discovery. in fact we may as well just assume that we will always have 1 grafananet/tsdb-gw/mt-gateway (these areall the same) output, and not kafka.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, and that becomes a lot easier once I move it to a top level command and don't have the existing root command kafka flags cluttering it up

}

var parrotCmd = &cobra.Command{
Use: "parrot",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

initial card said parrot-tests, do we want to change to that?

Copy link
Contributor

Choose a reason for hiding this comment

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

no. there is no need for the "-tests" suffix AFAICT

if orgs > 1 {
log.Fatal("parrot only works in single org mode")
}
initStats(false, "parrot")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

planning on reporting different stats on parrot query results, not sure if the default stats make sense or not?

Copy link
Contributor

Choose a reason for hiding this comment

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

they are useful though not critical
mainly I think we should report at each point in time the number of metrics that are incorrect.

@Dieterbe Dieterbe requested review from Dieterbe and removed request for a team February 6, 2020 10:58
@@ -0,0 +1,102 @@
package cmd
Copy link
Contributor

Choose a reason for hiding this comment

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

this tool is beyond just sending fake metrics.
as this will send fake data into a MT cluster and then query it back, it's a "real" MT testing tool, so i would put it in /cmd/mt-parrot. you then also don't have to do the cobra stuff.

Copy link
Contributor

Choose a reason for hiding this comment

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

to be clear, we don't want a tool that just sends the test data.
we want a tool that can execute the entire test.
it can use the fakemetrics library to do its work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

understood, was planning on adding that in next, just sanity checking this portion before building on it

Copy link
Contributor

Choose a reason for hiding this comment

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

also i realize this is a departure from the suggestion i have given you before (which was a new mode for fakemetrics tool + a separate query/test tool), but it seems to me doing both in one tool is simpler.


var (
parrotOrgId int
parrotPartitionCount int32
Copy link
Contributor

@Dieterbe Dieterbe Feb 6, 2020

Choose a reason for hiding this comment

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

these vars don't need the 'parrot' prefix AFAICT

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They don't need it, but I felt like the cmd/fakemetrics namespace was getting a little crowded. No longer a concern if we're moving to cmd/mt-parrot

@Dieterbe
Copy link
Contributor

Dieterbe commented Feb 6, 2020

let's also add the testing to the tool, and submitting the fail/success stats

@fitzoh
Copy link
Contributor Author

fitzoh commented Feb 11, 2020

Ran into a few issues with metrics not actually being ingested and failing quietly in mt-gateway, fixed in
16901f4
387bb7e
49dfb0a

Moving on to actually querying/verifying them

@fitzoh
Copy link
Contributor Author

fitzoh commented Feb 12, 2020

Gonna close this for now, expecting a decent amount of churn during troubleshooting

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants