mackerel-client-go is a Go client library for mackerel.io API.
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,
},
})
Now, mackerel-client-go is an ALPHA version. In the future release, it may change it's interface.
- Fork (https://github.com/mackerelio/mackerel-client-go/fork)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the
go test ./...
command and confirm that it passes - Run
gofmt -s
- Create new Pull Request
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.