Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Observability UIs] Simplify shared telemetry hooks #60505

Closed
jasonrhodes opened this issue Mar 18, 2020 · 2 comments
Closed

[Observability UIs] Simplify shared telemetry hooks #60505

jasonrhodes opened this issue Mar 18, 2020 · 2 comments
Assignees
Labels
Feature:Logs UI Logs UI feature Feature:Metrics UI Metrics UI feature Team:Observability Team label for Observability Team (for things that are handled across all of observability)

Comments

@jasonrhodes
Copy link
Member

We currently have a two function call telemetry hook setup, e.g.:

import { useUiTracker } from 'observability';

const trackApmEvent = useUiTracker({ app: 'apm' });
// when we want to track the event
trackApmEvent({ name: 'save_agent_configuration' });

In #58018, we discussed a lot of interesting ways we could improve this with React context, but for now we settled on simplifying down to a single hook call per event.

import { useTrackApmEvent } from 'observability';

// when we want to track the event
useTrackApmEvent({ name: 'save_agent_configuration' });

We can pass that function to a generic component if needed:

<GenericComponent trackEvent={useTrackApmEvent} />

We should also still expose a generic useTrackEvent hook that still takes the app value directly, in case that's needed.

@jasonrhodes jasonrhodes added the Team:Observability Team label for Observability Team (for things that are handled across all of observability) label Mar 18, 2020
@jasonrhodes jasonrhodes self-assigned this Mar 18, 2020
@jasonrhodes jasonrhodes added Feature:Logs UI Logs UI feature Feature:Metrics UI Metrics UI feature labels Mar 18, 2020
@jasonrhodes
Copy link
Member Author

We might close this and leave these hooks the way they are for now, based on the outcome of the conversation that comes from this comment: #58018 (comment)

I re-opened #58018 to discuss there.

@jasonrhodes
Copy link
Member Author

Leaving this API alone for now, see #58018 for further discussion etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Logs UI Logs UI feature Feature:Metrics UI Metrics UI feature Team:Observability Team label for Observability Team (for things that are handled across all of observability)
Projects
None yet
Development

No branches or pull requests

1 participant