Skip to content

mackerelio/mackerel-client-go

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

mackerel-client-go

Build Status Coverage Status pkg.go.dev

mackerel-client-go is a Go client library for mackerel.io API.

Usage

import "github.com/mackerelio/mackerel-client-go"
client := mackerel.NewClient("<Put your API key>")

hosts, err := client.FindHosts(&mackerel.FindHostsParam{
        Service: "My-Service",
        Roles: []string{"proxy"},
        Statuses: []string{mackerel.HostStatusWorking},
})

err := client.PostServiceMetricValues("My-Service", []*mackerel.MetricValue{
        &mackerel.MetricValue{
              Name:  "proxy.access_log.latency",
              Time:  123456789,
              Value: 500,
        },
})

CAUTION

Now, mackerel-client-go is an ALPHA version. In the future release, it may change it's interface.

CONTRIBUTION

  1. Fork (https://github.com/mackerelio/mackerel-client-go/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create new Pull Request

License

Copyright 2014 Hatena Co., Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.