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

Support Dashboard Metrics Storage Key #2483

Merged
merged 23 commits into from
May 26, 2020

Conversation

Yisaer
Copy link
Contributor

@Yisaer Yisaer commented May 18, 2020

What problem does this PR solve?

close #2331

This request sync prometheus and grafana information into pd etcd with tidb nightly verison. I leave alertmanager into ucp. Here is the demo:

image

image

Does this PR introduce a user-facing change?:

Support `Dashboard` metrics ability for `TidbCluster` when `TidbMonitor` deployed 

@Yisaer
Copy link
Contributor Author

Yisaer commented May 18, 2020

/run-e2e-in-kind

pkg/manager/member/tidbcluster_status_manager.go Outdated Show resolved Hide resolved
if err != nil {
return err
}
return tcsm.syncDashboardMetricStorage(tc, tm)
Copy link
Contributor

Choose a reason for hiding this comment

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

Status manager should focus on the status update, can we move the etcd key operation to a separate function out of the status manager?

Copy link
Contributor Author

@Yisaer Yisaer May 18, 2020

Choose a reason for hiding this comment

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

Currently, i think it is not necessary as we only sync etcd key for MonitorRef. If there are more new actions for ectd operation, it will be ok for me to split it as an independent manager.

@Yisaer Yisaer requested a review from DanielZhangQD May 19, 2020 05:20
)

type PDEtcdApi interface {
type PDEtcdClient interface {
// PutKey would put key to the target pd etcd cluster
Copy link
Contributor

Choose a reason for hiding this comment

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

why use would here? At the end of the function, the put/delete operation may not finish?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the comment is misleading, I should use will here.

pkg/pdapi/pdetcd.go Outdated Show resolved Hide resolved
@Yisaer Yisaer requested a review from cofyc May 20, 2020 06:26
cofyc
cofyc previously approved these changes May 20, 2020
@@ -72,6 +75,32 @@ func GetTLSConfig(kubeCli kubernetes.Interface, namespace Namespace, tcName stri
return crypto.LoadTlsConfigFromSecret(secret, caCert)
}

func (pdc *defaultPDControl) GetPDEtcdClient(namespace Namespace, tcName string, tlsEnabled bool) (PDEtcdClient, error) {
pdc.mutex.Lock()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest define separate mutex here, it's an independent client with existing PDClient.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated.

@Yisaer
Copy link
Contributor Author

Yisaer commented May 20, 2020

/run-e2e-in-kind

Copy link
Contributor

@DanielZhangQD DanielZhangQD left a comment

Choose a reason for hiding this comment

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

LGTM

@Yisaer
Copy link
Contributor Author

Yisaer commented May 25, 2020

/merge

@sre-bot
Copy link
Contributor

sre-bot commented May 25, 2020

Your auto merge job has been accepted, waiting for:

  • 2524
  • 2508

@sre-bot
Copy link
Contributor

sre-bot commented May 25, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented May 25, 2020

@Yisaer merge failed.

@cofyc
Copy link
Contributor

cofyc commented May 25, 2020

/run-e2e-tests

1 similar comment
@Yisaer
Copy link
Contributor Author

Yisaer commented May 25, 2020

/run-e2e-tests

@Yisaer
Copy link
Contributor Author

Yisaer commented May 25, 2020

/merge

@sre-bot
Copy link
Contributor

sre-bot commented May 25, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented May 25, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented May 25, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented May 25, 2020

@Yisaer merge failed.

@Yisaer Yisaer merged commit f6fcb6b into pingcap:master May 26, 2020
@Yisaer
Copy link
Contributor Author

Yisaer commented Jun 8, 2020

/run-cherry-picker

sre-bot pushed a commit to sre-bot/tidb-operator that referenced this pull request Jun 8, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor

sre-bot commented Jun 8, 2020

cherry pick to release-1.1 in PR #2644

sre-bot added a commit that referenced this pull request Jun 8, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>

Co-authored-by: Song Gao <disxiaofei@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto configure pd-server metric-storage
5 participants