Skip to content

Commit 3bcba8b

Browse files
committed
Rename Prism to Cortex
Part of #70
1 parent b1fbace commit 3bcba8b

24 files changed

+209
-209
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
cmd/prism/prism
1+
cmd/cortex/cortex
22
.uptodate
33
.pkg

Makefile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ images:
2525
$(info $(IMAGE_NAMES))
2626

2727
# List of exes please
28-
PRISM_EXE := ./cmd/prism/prism
29-
EXES = $(PRISM_EXE)
28+
CORTEX_EXE := ./cmd/cortex/cortex
29+
EXES = $(CORTEX_EXE)
3030

3131
all: $(UPTODATE_FILES)
3232

3333
# And what goes into each exe
34-
$(PRISM_EXE): $(shell find . -name '*.go') $(shell find ui/static ui/templates)
34+
$(CORTEX_EXE): $(shell find . -name '*.go') $(shell find ui/static ui/templates)
3535

3636
# And now what goes into each image
37-
prism-build/$(UPTODATE): prism-build/*
38-
cmd/prism/$(UPTODATE): $(PRISM_EXE)
37+
cortex-build/$(UPTODATE): cortex-build/*
38+
cmd/cortex/$(UPTODATE): $(CORTEX_EXE)
3939

4040
# All the boiler plate for building golang follows:
4141
SUDO := $(shell docker info >/dev/null 2>&1 || echo "sudo -E")
@@ -53,23 +53,23 @@ NETGO_CHECK = @strings $@ | grep cgo_stub\\\.go >/dev/null || { \
5353

5454
ifeq ($(BUILD_IN_CONTAINER),true)
5555

56-
$(EXES) lint test assets: prism-build/$(UPTODATE)
56+
$(EXES) lint test assets: cortex-build/$(UPTODATE)
5757
@mkdir -p $(shell pwd)/.pkg
5858
$(SUDO) docker run $(RM) -ti \
5959
-v $(shell pwd)/.pkg:/go/pkg \
60-
-v $(shell pwd):/go/src/github.com/weaveworks/prism \
61-
$(IMAGE_PREFIX)/prism-build $@
60+
-v $(shell pwd):/go/src/github.com/weaveworks/cortex \
61+
$(IMAGE_PREFIX)/cortex-build $@
6262

6363
else
6464

65-
$(EXES): prism-build/$(UPTODATE)
65+
$(EXES): cortex-build/$(UPTODATE)
6666
go build $(GO_FLAGS) -o $@ ./$(@D)
6767
$(NETGO_CHECK)
6868

69-
lint: prism-build/$(UPTODATE)
69+
lint: cortex-build/$(UPTODATE)
7070
./tools/lint -notestpackage -ignorespelling queriers -ignorespelling Queriers .
7171

72-
test: prism-build/$(UPTODATE)
72+
test: cortex-build/$(UPTODATE)
7373
./tools/test -no-go-get
7474

7575
# Manual step that needs to be run after making any changes to the web assets
@@ -78,7 +78,7 @@ test: prism-build/$(UPTODATE)
7878
# TODO(juliusv): Figure out if we can make this an automatic part of the build
7979
# process. It currently produces diffs (source file timestamps are getting
8080
# baked into bindata.go) and those make CI fail.
81-
assets: prism-build/$(UPTODATE)
81+
assets: cortex-build/$(UPTODATE)
8282
go-bindata -pkg ui -o ui/bindata.go -ignore '(.*\.map|bootstrap\.js|bootstrap-theme\.css|bootstrap\.css)' ui/templates/... ui/static/...
8383

8484
endif

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Prism: A multitenant, horizontally scalable Prometheus as a service
1+
# Cortex: A multitenant, horizontally scalable Prometheus as a service
22

3-
[![Circle CI](https://circleci.com/gh/weaveworks/prism/tree/master.svg?style=shield)](https://circleci.com/gh/weaveworks/prism/tree/master)
3+
[![Circle CI](https://circleci.com/gh/weaveworks/cortex/tree/master.svg?style=shield)](https://circleci.com/gh/weaveworks/cortex/tree/master)
44
[![Slack Status](https://slack.weave.works/badge.svg)](https://slack.weave.works)
55

66
*NB this is a pre-release, pre-alpha service. Availability will not be 100%.
77
APIs will change. Data will be lost.*
88

9-
Prism is an API compatible [Prometheus](https://prometheus.io)
9+
Cortex is an API compatible [Prometheus](https://prometheus.io)
1010
implementation, that natively supports multitenancy and scale-out clustering.
1111

12-
Prism is a [Weaveworks](https://weave.works) project that forms a major part
12+
Cortex is a [Weaveworks](https://weave.works) project that forms a major part
1313
of [Weave Cloud](https://cloud.weave.works). If you are interested in using
1414
our hosted Prometheus as a service, please
1515

chunk/chunk_store.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import (
3636
"github.com/weaveworks/scope/common/instrument"
3737
"golang.org/x/net/context"
3838

39-
"github.com/weaveworks/prism/user"
39+
"github.com/weaveworks/cortex/user"
4040
)
4141

4242
const (
@@ -51,29 +51,29 @@ const (
5151

5252
var (
5353
dynamoRequestDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{
54-
Namespace: "prism",
54+
Namespace: "cortex",
5555
Name: "dynamo_request_duration_seconds",
5656
Help: "Time spent doing DynamoDB requests.",
5757
Buckets: []float64{.001, .0025, .005, .01, .025, .05, .1, .25, .5, 1},
5858
}, []string{"operation", "status_code"})
5959
dynamoRequestPages = prometheus.NewHistogram(prometheus.HistogramOpts{
60-
Namespace: "prism",
60+
Namespace: "cortex",
6161
Name: "dynamo_request_pages",
6262
Help: "Number of pages by DynamoDB request",
6363
Buckets: prometheus.ExponentialBuckets(1, 2.0, 5),
6464
})
6565
dynamoConsumedCapacity = prometheus.NewCounterVec(prometheus.CounterOpts{
66-
Namespace: "prism",
66+
Namespace: "cortex",
6767
Name: "dynamo_consumed_capacity_total",
6868
Help: "The capacity units consumed by operation.",
6969
}, []string{"operation"})
7070
droppedMatches = prometheus.NewCounter(prometheus.CounterOpts{
71-
Namespace: "prism",
71+
Namespace: "cortex",
7272
Name: "dropped_matches_total",
7373
Help: "The number of chunks fetched but later dropped for not matching.",
7474
})
7575
s3RequestDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{
76-
Namespace: "prism",
76+
Namespace: "cortex",
7777
Name: "s3_request_duration_seconds",
7878
Help: "Time spent doing S3 requests.",
7979
Buckets: []float64{.025, .05, .1, .25, .5, 1, 2},

chunk/chunk_store_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"github.com/tomwilkie/go-mockaws"
2727
"golang.org/x/net/context"
2828

29-
"github.com/weaveworks/prism/user"
29+
"github.com/weaveworks/cortex/user"
3030
)
3131

3232
func init() {

circle.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ deployment:
1919
branch: master
2020
commands:
2121
- docker login -e "$DOCKER_REGISTRY_EMAIL" -u "$DOCKER_REGISTRY_USER" -p "$DOCKER_REGISTRY_PASSWORD"
22-
- docker push weaveworks/prism:$(./tools/image-tag)
23-
- wcloud deploy -u circle weaveworks/prism:$(./tools/image-tag)
22+
- docker push weaveworks/cortex:$(./tools/image-tag)
23+
- wcloud deploy -u circle weaveworks/cortex:$(./tools/image-tag)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM quay.io/prometheus/busybox:latest
2-
COPY prism /bin/prism
2+
COPY cortex /bin/cortex
33
EXPOSE 9094
4-
ENTRYPOINT [ "/bin/prism" ]
4+
ENTRYPOINT [ "/bin/cortex" ]

cmd/prism/main.go renamed to cmd/cortex/main.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ import (
3131
"github.com/weaveworks/scope/common/middleware"
3232
"golang.org/x/net/context"
3333

34-
"github.com/weaveworks/prism"
35-
"github.com/weaveworks/prism/chunk"
36-
"github.com/weaveworks/prism/ingester"
37-
"github.com/weaveworks/prism/ring"
38-
"github.com/weaveworks/prism/ui"
39-
"github.com/weaveworks/prism/user"
34+
"github.com/weaveworks/cortex"
35+
"github.com/weaveworks/cortex/chunk"
36+
"github.com/weaveworks/cortex/ingester"
37+
"github.com/weaveworks/cortex/ring"
38+
"github.com/weaveworks/cortex/ui"
39+
"github.com/weaveworks/cortex/user"
4040
)
4141

4242
const (
@@ -49,7 +49,7 @@ const (
4949

5050
var (
5151
requestDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{
52-
Namespace: "prism",
52+
Namespace: "cortex",
5353
Name: "request_duration_seconds",
5454
Help: "Time (in seconds) spent serving HTTP requests.",
5555
Buckets: prometheus.DefBuckets,
@@ -78,7 +78,7 @@ type cfg struct {
7878
numTokens int
7979
logSuccess bool
8080

81-
distributorConfig prism.DistributorConfig
81+
distributorConfig cortex.DistributorConfig
8282
}
8383

8484
func main() {
@@ -120,8 +120,8 @@ func main() {
120120
case modeDistributor:
121121
ring := ring.New(consul)
122122
cfg.distributorConfig.Ring = ring
123-
cfg.distributorConfig.ClientFactory = func(address string) (*prism.IngesterClient, error) {
124-
return prism.NewIngesterClient(address, cfg.remoteTimeout)
123+
cfg.distributorConfig.ClientFactory = func(address string) (*cortex.IngesterClient, error) {
124+
return cortex.NewIngesterClient(address, cfg.remoteTimeout)
125125
}
126126
defer ring.Stop()
127127
setupDistributor(cfg.distributorConfig, chunkStore, cfg.logSuccess)
@@ -186,18 +186,18 @@ func setupChunkStore(cfg cfg) (chunk.Store, error) {
186186
}
187187

188188
func setupDistributor(
189-
cfg prism.DistributorConfig,
189+
cfg cortex.DistributorConfig,
190190
chunkStore chunk.Store,
191191
logSuccess bool,
192192
) {
193-
distributor, err := prism.NewDistributor(cfg)
193+
distributor, err := cortex.NewDistributor(cfg)
194194
if err != nil {
195195
log.Fatal(err)
196196
}
197197
prometheus.MustRegister(distributor)
198198

199199
prefix := "/api/prom"
200-
http.Handle(prefix+"/push", instrument(logSuccess, prism.AppenderHandler(distributor)))
200+
http.Handle(prefix+"/push", instrument(logSuccess, cortex.AppenderHandler(distributor)))
201201

202202
// TODO: Move querier to separate binary.
203203
setupQuerier(distributor, chunkStore, prefix, logSuccess)
@@ -209,15 +209,15 @@ func setupDistributor(
209209
// |
210210
// `----------> ChunkQuerier -> DynamoDB/S3
211211
func setupQuerier(
212-
distributor *prism.Distributor,
212+
distributor *cortex.Distributor,
213213
chunkStore chunk.Store,
214214
prefix string,
215215
logSuccess bool,
216216
) {
217-
querier := prism.MergeQuerier{
218-
Queriers: []prism.Querier{
217+
querier := cortex.MergeQuerier{
218+
Queriers: []cortex.Querier{
219219
distributor,
220-
&prism.ChunkQuerier{
220+
&cortex.ChunkQuerier{
221221
Store: chunkStore,
222222
},
223223
},
@@ -256,9 +256,9 @@ func setupIngester(
256256
}
257257
prometheus.MustRegister(ingester)
258258

259-
http.Handle("/push", instrument(logSuccess, prism.AppenderHandler(ingester)))
260-
http.Handle("/query", instrument(logSuccess, prism.QueryHandler(ingester)))
261-
http.Handle("/label_values", instrument(logSuccess, prism.LabelValuesHandler(ingester)))
259+
http.Handle("/push", instrument(logSuccess, cortex.AppenderHandler(ingester)))
260+
http.Handle("/query", instrument(logSuccess, cortex.QueryHandler(ingester)))
261+
http.Handle("/label_values", instrument(logSuccess, cortex.LabelValuesHandler(ingester)))
262262
return ingester
263263
}
264264

File renamed without changes.

prism-build/build.sh renamed to cortex-build/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -eu
44

5-
SRC_PATH=$GOPATH/src/github.com/weaveworks/prism
5+
SRC_PATH=$GOPATH/src/github.com/weaveworks/cortex
66

77
# If we run make directly, any files created on the bind mount
88
# will have awkward ownership. So we switch to a user with the

prism.pb.go renamed to cortex.pb.go

Lines changed: 42 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

prism.proto renamed to cortex.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
syntax = "proto3";
22

3-
package prism;
3+
package cortex;
44

55
message Sample {
66
double value = 1;

0 commit comments

Comments
 (0)