Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: switch agent to use v2 API for sending logs#12068

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
spikecurtis merged 1 commit intomainfromspike/10534-agent-logs-v2-api
Feb 23, 2024

Conversation

spikecurtis
Copy link
Contributor

@spikecurtisspikecurtis commentedFeb 8, 2024
edited
Loading

Changes the agent to use the new v2 API for sending logs, via the logSender component.

We keep the PatchLogs function around, but deprecate it so that we can test the v1 endpoint.

@spikecurtisGraphite App
Copy link
ContributorAuthor

spikecurtis commentedFeb 8, 2024
edited
Loading

This stack of pull requests is managed by Graphite.Learn more about stacking.

Join@spikecurtis and the rest of your teammates onGraphiteGraphite

@spikecurtisspikecurtis changed the titlefeat: use agent v2 API to send agent logsfeat: change agent to use v2 API to send agent logsFeb 8, 2024
@spikecurtisspikecurtis marked this pull request as ready for reviewFebruary 8, 2024 11:50
@spikecurtisspikecurtisforce-pushed thespike/10534-log-queue-limit branch from4a32bba to14d0583CompareFebruary 9, 2024 11:54
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-logs-v2-api branch from1c29364 to6f02c02CompareFebruary 9, 2024 11:55
@spikecurtisspikecurtisforce-pushed thespike/10534-log-queue-limit branch from14d0583 to2014110CompareFebruary 9, 2024 12:05
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-logs-v2-api branch from6f02c02 to7d7df61CompareFebruary 9, 2024 12:05
@spikecurtisspikecurtisforce-pushed thespike/10534-log-queue-limit branch from2014110 to446cb12CompareFebruary 9, 2024 12:54
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-logs-v2-api branch from7d7df61 to3106dacCompareFebruary 9, 2024 12:54
Base automatically changed fromspike/10534-log-queue-limit tospike/10534-log-senderFebruary 9, 2024 12:57
@spikecurtisspikecurtisforce-pushed thespike/10534-log-sender branch 2 times, most recently from5f74643 tof25da2cCompareFebruary 15, 2024 12:46
Base automatically changed fromspike/10534-log-sender tomainFebruary 15, 2024 12:57
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-logs-v2-api branch from3106dac to72a8e58CompareFebruary 20, 2024 11:16
@spikecurtisspikecurtis changed the base branch frommain tospike/10534-agent-api-routinesFebruary 20, 2024 11:16
@spikecurtisspikecurtis changed the titlefeat: change agent to use v2 API to send agent logsfeat: switch agent to use v2 API for sending logsFeb 20, 2024
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-api-routines branch from40bd260 to08764ffCompareFebruary 20, 2024 12:15
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-logs-v2-api branch from72a8e58 to67539d6CompareFebruary 20, 2024 12:15
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-api-routines branch from08764ff to4ce9f1dCompareFebruary 20, 2024 12:37
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-logs-v2-api branch from67539d6 tod92399dCompareFebruary 20, 2024 12:37
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-api-routines branch from4ce9f1d to7ecf10eCompareFebruary 20, 2024 12:58
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-logs-v2-api branch fromd92399d to6b20b22CompareFebruary 20, 2024 12:58
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-api-routines branch from7ecf10e to2f05031CompareFebruary 20, 2024 16:19
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-logs-v2-api branch from6b20b22 to249076eCompareFebruary 20, 2024 16:19
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-api-routines branch from2f05031 to5cf1bb4CompareFebruary 22, 2024 05:42
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-logs-v2-api branch from249076e to103c6e3CompareFebruary 22, 2024 05:42
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-api-routines branch from5cf1bb4 tof9ca6b2CompareFebruary 22, 2024 06:14
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-logs-v2-api branch from103c6e3 to8e4eab1CompareFebruary 22, 2024 06:14
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-api-routines branch fromf9ca6b2 tod9b360cCompareFebruary 22, 2024 08:15
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-logs-v2-api branch from8e4eab1 to425a947CompareFebruary 22, 2024 08:15
// shutdown scripts.
connMan.start("send logs",gracefulShutdownBehaviorRemain,
func(ctx context.Context,conn drpc.Conn)error {
err:=a.logSender.SendLoop(ctx,proto.NewDRPCAgentClient(conn))
Copy link
Member

Choose a reason for hiding this comment

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

Is it good practice to use multiple clients over the same conn, or should we define the client in the parent scope?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

The client contains no state other than the conn itself. It just maps RPC methods toInvoke orNewStream calls on the conn.

So, I think it's totally reasonable to make a new one per routine. That allows me to keep theconnMan generic with adrpc.Conn. There are actually 2 different proto APIs (tailnet and agent) with their own client types.

@@ -2062,6 +2062,80 @@ func TestAgent_DebugServer(t *testing.T) {
})
}

funcTestAgent_ScriptLogging(t*testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

❤️

RunOnStop:true,
Script:`#!/bin/sh
i=0
while [ $i -ne 3000 ]
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if 3000 is flake-risky, considering we're using WaitMedium?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Running on its own, the script part completes in ~100ms, including queueing all the logs, sending them, and asserting them in the test. If it flakes, something else is very wrong.

Copy link
Member

Choose a reason for hiding this comment

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

Sure 👍🏻. I was mostly just worried about Windows, it can be unfathomably slow 😄

Base automatically changed fromspike/10534-agent-api-routines tomainFebruary 23, 2024 07:04
@spikecurtisspikecurtisforce-pushed thespike/10534-agent-logs-v2-api branch from425a947 to943991fCompareFebruary 23, 2024 07:20
@spikecurtisspikecurtis merged commit4cc132c intomainFeb 23, 2024
@spikecurtisspikecurtis deleted the spike/10534-agent-logs-v2-api branchFebruary 23, 2024 07:27
@spikecurtisGraphite App
Copy link
ContributorAuthor

Merge activity

@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsFeb 23, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

Assignees

@spikecurtisspikecurtis

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@spikecurtis@mafredri

[8]ページ先頭

©2009-2025 Movatter.jp